Skip to content

README: Note that rustfmt_skip on non-inline mod quiets line length warnings #1406

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

Conversation

8573
Copy link

@8573 8573 commented Mar 24, 2017

In the README.md document, note, after the introduction of the
rustfmt_skip attribute, that using that attribute on a non-inline
mod item will cause the file referenced by that item to be wholly
ignored by rustfmt, in contrast to the normal behavior of still
emitting warnings on lines in skipped sections of code that exceed the
line length limit.

My motivation for this change is my former confusion as to this
behavior, as shown in issue #1399.

(I suppose, however, that merging of this patch should wait on the
resolution of solson's concerns.)

In the `README.md` document, note, after the introduction of the
`rustfmt_skip` attribute, that using that attribute on a non-inline
`mod` item will cause the file referenced by that item to be wholly
ignored by rustfmt, in contrast to the normal behavior of still
emitting warnings on lines in skipped sections of code that exceed the
line length limit.
@nrc
Copy link
Member

nrc commented Mar 26, 2017

While this is correct, I don't think it is quite indicating the right mental model. Rustfmt will format the whole program skipping any nodes with a skip attribute. It will then run its warning pass on any files it knows about. Whether a module is skipped or not (c.f., any other node) doesn't really make a difference (for example if you skip an inline module, that module will be warned on, but if that module imports an out of line one, that file will not be checked).

@nrc nrc closed this May 3, 2017
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.

2 participants