Skip to content

Make child module formatting optional #400

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

Closed
constancebello opened this issue Sep 29, 2015 · 3 comments
Closed

Make child module formatting optional #400

constancebello opened this issue Sep 29, 2015 · 3 comments
Labels
good first issue Issues up for grabs, also good candidates for new rustfmt contributors

Comments

@constancebello
Copy link

Some projects (such as uutils/coreutils) have a non-traditional building scheme where some common files are used by multiple crates. In this case, it is a waste of effort to format child modules (and can lead to confusion, see #399). It would be useful to have a rustfmt.toml option to disable this functionality, while keeping the default behavior.

@nrc nrc added the good first issue Issues up for grabs, also good candidates for new rustfmt contributors label Sep 29, 2015
@nrc
Copy link
Member

nrc commented Sep 29, 2015

Sounds like a nice option to have. Not as easy as you might expect (or the label might lead you to expect).

@marcusklaas
Copy link
Contributor

How would one do this? Is there a way to prevent the parser from walking the modules?

@nrc
Copy link
Member

nrc commented Oct 1, 2015

You can't stop parsing, but you can stop reformatting by simply not continuing to walk in the Visitor implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues up for grabs, also good candidates for new rustfmt contributors
Projects
None yet
Development

No branches or pull requests

3 participants