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

Warn when ignore-tidy-linelength is present, but no lines are too long #60169

Merged
merged 7 commits into from Apr 23, 2019

Conversation

Projects
None yet
6 participants
@varkor
Copy link
Member

commented Apr 22, 2019

It's easy for a // ignore-tidy-linelength to be added when there is a genuine need to ignore a file's line length, but then after refactoring the need is gone, but the tidy directive is not removed. This means that in the future, further editing may accidentally add unnecessarily long lines. This change forces // ignore-tidy-linelength to be used exactly when necessary, to make sure such changes are intentional.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Apr 22, 2019

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@varkor

This comment has been minimized.

Copy link
Member Author

commented Apr 22, 2019

@varkor varkor force-pushed the varkor:tidy-unnecessary-ignore-newline branch from 6a6400a to 1da5d9d Apr 22, 2019

@kennytm

This comment has been minimized.

Copy link
Member

commented Apr 22, 2019

r=me after Travis passes.

@petrochenkov

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2019

This kind of logic is applicable to all tidy rules.

// ignore-tidy-x && not x -> tidy error

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2019

☔️ The latest upstream changes (presumably #60168) made this pull request unmergeable. Please resolve the merge conflicts.

@varkor varkor force-pushed the varkor:tidy-unnecessary-ignore-newline branch from 25fb915 to c2895a5 Apr 22, 2019

@varkor

This comment has been minimized.

Copy link
Member Author

commented Apr 22, 2019

@kennytm: I've updated the PR to also warn when other tidy ignore directives are present, but have no effect. Could you check to make sure the changes are still okay?

@kennytm

This comment has been minimized.

Copy link
Member

commented Apr 23, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

📌 Commit c2895a5 has been approved by kennytm

kennytm added a commit to kennytm/rust that referenced this pull request Apr 23, 2019

Rollup merge of rust-lang#60169 - varkor:tidy-unnecessary-ignore-newl…
…ine, r=kennytm

Warn when ignore-tidy-linelength is present, but no lines are too long

It's easy for a `// ignore-tidy-linelength` to be added when there is a genuine need to ignore a file's line length, but then after refactoring the need is gone, but the tidy directive is not removed. This means that in the future, further editing may accidentally add unnecessarily long lines. This change forces `// ignore-tidy-linelength` to be used exactly when necessary, to make sure such changes are intentional.

bors added a commit that referenced this pull request Apr 23, 2019

Auto merge of #60189 - kennytm:rollup-8xgg35r, r=kennytm
Rollup of 6 pull requests

Successful merges:

 - #59839 (Warn on unused results for operation methods on nums)
 - #60146 (Update fonts used by rustdoc)
 - #60169 (Warn when ignore-tidy-linelength is present, but no lines are too long)
 - #60172 (Disallow double trailing newlines in tidy)
 - #60177 (Promote rust comments to rustdoc)
 - #60180 (Update cargo, books)

Failed merges:

r? @ghost
@kennytm

This comment has been minimized.

Copy link
Member

commented Apr 23, 2019

@bors r-

This PR failed in the rollup #60189, because #60172 has accidentally removed the CRLF line endings from src/test/run-pass/issues/issue-16278.rs (see #16278). They need to be added back. (Congratulations in detecting a regression? 🙃)

Screenshot 2019-04-23 at 17 50 26-fs8

@varkor

This comment has been minimized.

Copy link
Member Author

commented Apr 23, 2019

This PR failed in the rollup #60189, because #60172 has accidentally removed the CRLF line endings

Ah, this was very easy to miss — the line endings were converted silently as soon as I modified the file 😬
I've reverted the change and am checking everything now passes again.

@varkor varkor force-pushed the varkor:tidy-unnecessary-ignore-newline branch from c2895a5 to 5ab5806 Apr 23, 2019

@varkor

This comment has been minimized.

Copy link
Member Author

commented Apr 23, 2019

@bors r=kennytm

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

📌 Commit 5ab5806 has been approved by kennytm

Centril added a commit to Centril/rust that referenced this pull request Apr 23, 2019

Rollup merge of rust-lang#60169 - varkor:tidy-unnecessary-ignore-newl…
…ine, r=kennytm

Warn when ignore-tidy-linelength is present, but no lines are too long

It's easy for a `// ignore-tidy-linelength` to be added when there is a genuine need to ignore a file's line length, but then after refactoring the need is gone, but the tidy directive is not removed. This means that in the future, further editing may accidentally add unnecessarily long lines. This change forces `// ignore-tidy-linelength` to be used exactly when necessary, to make sure such changes are intentional.

Centril added a commit to Centril/rust that referenced this pull request Apr 23, 2019

Rollup merge of rust-lang#60169 - varkor:tidy-unnecessary-ignore-newl…
…ine, r=kennytm

Warn when ignore-tidy-linelength is present, but no lines are too long

It's easy for a `// ignore-tidy-linelength` to be added when there is a genuine need to ignore a file's line length, but then after refactoring the need is gone, but the tidy directive is not removed. This means that in the future, further editing may accidentally add unnecessarily long lines. This change forces `// ignore-tidy-linelength` to be used exactly when necessary, to make sure such changes are intentional.

bors added a commit that referenced this pull request Apr 23, 2019

Auto merge of #60208 - Centril:rollup-vg8gl67, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #59739 (Stabilize futures_api)
 - #59839 (Warn on unused results for operation methods on nums)
 - #60146 (Update fonts used by rustdoc)
 - #60169 (Warn when ignore-tidy-linelength is present, but no lines are too long)
 - #60177 (Promote rust comments to rustdoc)
 - #60191 (Add f16c target_feature)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Apr 23, 2019

Rollup merge of rust-lang#60169 - varkor:tidy-unnecessary-ignore-newl…
…ine, r=kennytm

Warn when ignore-tidy-linelength is present, but no lines are too long

It's easy for a `// ignore-tidy-linelength` to be added when there is a genuine need to ignore a file's line length, but then after refactoring the need is gone, but the tidy directive is not removed. This means that in the future, further editing may accidentally add unnecessarily long lines. This change forces `// ignore-tidy-linelength` to be used exactly when necessary, to make sure such changes are intentional.

Centril added a commit to Centril/rust that referenced this pull request Apr 23, 2019

Rollup merge of rust-lang#60169 - varkor:tidy-unnecessary-ignore-newl…
…ine, r=kennytm

Warn when ignore-tidy-linelength is present, but no lines are too long

It's easy for a `// ignore-tidy-linelength` to be added when there is a genuine need to ignore a file's line length, but then after refactoring the need is gone, but the tidy directive is not removed. This means that in the future, further editing may accidentally add unnecessarily long lines. This change forces `// ignore-tidy-linelength` to be used exactly when necessary, to make sure such changes are intentional.

bors added a commit that referenced this pull request Apr 23, 2019

Auto merge of #60211 - Centril:rollup-akw4r85, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #59823 ([wg-async-await] Drop `async fn` arguments in async block )
 - #59839 (Warn on unused results for operation methods on nums)
 - #60146 (Update fonts used by rustdoc)
 - #60169 (Warn when ignore-tidy-linelength is present, but no lines are too long)
 - #60177 (Promote rust comments to rustdoc)
 - #60191 (Add f16c target_feature)

Failed merges:

r? @ghost

@bors bors merged commit 5ab5806 into rust-lang:master Apr 23, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

@varkor varkor deleted the varkor:tidy-unnecessary-ignore-newline branch Apr 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.