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

Rollup of 6 pull requests #60189

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
53d2473
warn on unused results for operation methods on nums
KodrAus Apr 10, 2019
23154db
fix up unused wrappingn_add in compile-pass test
KodrAus Apr 10, 2019
e14819a
Update Source Serif Pro fonts to version 2.010
Manishearth Apr 21, 2019
6bafc58
Update Source Code Pro fonts to version 2.030
Manishearth Apr 21, 2019
cdca41d
Update Fira Sans to version 4.202
Manishearth Apr 21, 2019
7f0f0e3
Remove double trailing newlines
varkor Apr 22, 2019
a43ccb0
Disallow double trailing newlines in tidy
varkor Apr 22, 2019
517fb1b
Promote rust comments to rustdoc
rasendubi Apr 22, 2019
f571b95
Update ui tests
varkor Apr 22, 2019
cfa4c10
Look specifically for comments containing tidy ignore directives
varkor Apr 22, 2019
1f79f3c
Tidy warn on ignored line length when lines are not too long
varkor Apr 22, 2019
8676a21
Remove unnecessary ignore-tidy-linelength
varkor Apr 22, 2019
d2185a2
Update ui tests
varkor Apr 22, 2019
921a431
Check for other unused tidy check directives
varkor Apr 22, 2019
c2895a5
Remove unnecessary tidy ignore directives
varkor Apr 22, 2019
ac8e397
Update cargo, books
ehuss Apr 22, 2019
5c9a234
Rollup merge of #59839 - KodrAus:must-use-num, r=sfackler
kennytm Apr 23, 2019
35fe722
Rollup merge of #60146 - Manishearth:font-update, r=QuietMisdreavus
kennytm Apr 23, 2019
f8ade8e
Rollup merge of #60169 - varkor:tidy-unnecessary-ignore-newline, r=ke…
kennytm Apr 23, 2019
b1fdd5a
Rollup merge of #60172 - varkor:tidy-double-trailing-newline, r=kennytm
kennytm Apr 23, 2019
e8aa036
Rollup merge of #60177 - rasendubi:rustdoc-comments, r=varkor
kennytm Apr 23, 2019
2a2198c
Rollup merge of #60180 - ehuss:update-cargo-books, r=alexcrichton
kennytm Apr 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Look specifically for comments containing tidy ignore directives
  • Loading branch information
varkor committed Apr 22, 2019
commit cfa4c1019d86e4b3b180b58ad31826a47593a970
15 changes: 10 additions & 5 deletions src/tools/tidy/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ fn long_line_is_ok(line: &str) -> bool {
false
}

fn contains_ignore_directive(contents: &String, check: &str) -> bool {
contents.contains(&format!("// ignore-tidy-{}", check)) ||
contents.contains(&format!("# ignore-tidy-{}", check))
}

pub fn check(path: &Path, bad: &mut bool) {
let mut contents = String::new();
super::walk(path, &mut super::filter_dirs, &mut |file| {
Expand All @@ -107,11 +112,11 @@ pub fn check(path: &Path, bad: &mut bool) {
tidy_error!(bad, "{}: empty file", file.display());
}

let skip_cr = contents.contains("ignore-tidy-cr");
let skip_tab = contents.contains("ignore-tidy-tab");
let skip_length = contents.contains("ignore-tidy-linelength");
let skip_end_whitespace = contents.contains("ignore-tidy-end-whitespace");
let skip_copyright = contents.contains("ignore-tidy-copyright");
let skip_cr = contains_ignore_directive(&contents, "cr");
let skip_tab = contains_ignore_directive(&contents, "tab");
let skip_length = contains_ignore_directive(&contents, "linelength");
let skip_end_whitespace = contains_ignore_directive(&contents, "end-whitespace");
let skip_copyright = contains_ignore_directive(&contents, "copyright");
let mut leading_new_lines = false;
let mut trailing_new_lines = 0;
for (i, line) in contents.split('\n').enumerate() {
Expand Down