Skip to content

emilio/rustfmt-format-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

rustfmt-format-diff

This is a small python script, in the spirit of clang-format-diff, that takes care of reading a diff, and running rustfmt with the --file-lines option appropriately.

This is intended to allow projects to incrementally adopt rustfmt, without massive patches.

Usage

To format your last git commit, for example:

$ git diff HEAD~ | python rustfmt-format-diff.py -p 1

Known issues

Right now this is pretty much as fine-grained as it could be, but rustfmt isn't (see rust-lang/rustfmt#1835).

With that fixed, the idea is to use it in bindgen, and then ideally Servo, to get consistent formatting across the board without much disruption. Ideally even as a commit hook.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages