Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat modules in external files #122

Merged
merged 4 commits into from
Jul 5, 2015
Merged

Conversation

cassiersg
Copy link
Contributor

The trickiest part was to identify the file a module belongs to. The technique previously used doesn't work with modules that contains only comments (no items), so I used the same algorithm as rustc, looking for the path attribute and then defaulting to X.rs and X/mod.rs.

At the end, we get all our code reformatted ! (There was a lot of misformatted code ;)

The first two commits are two small issues I discovered while reformatting the code of rustfmt. (I you feel these needs separate issues/PR, please ask it.)

Closes #118

@marcusklaas
Copy link
Contributor

Great work, @cassiersg!

cassiersg added 2 commits July 3, 2015 10:30
An opening paren in generics caused a false-positive detection of args
beginning. The result was the creation of comments with some code into
it.
@cassiersg
Copy link
Contributor Author

Rebased & added FIXME's with pointers to rust-lang/rust#26755 and rust-lang/rust#26750.

nrc added a commit that referenced this pull request Jul 5, 2015
Reformat modules in external files
@nrc nrc merged commit 04cf309 into rust-lang:master Jul 5, 2015
@cassiersg cassiersg deleted the fix-mod branch August 27, 2015 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants