diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2019-11-27 15:28:50 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-27 15:28:50 -0600 |
| commit | 6a1fe67cac7866941dacd735f899f4532c816faa (patch) | |
| tree | 49ed6058a00e2c4031a2cf4492cf1f58780ff30d /src/tools | |
| parent | ae49770918af86a3eac0471461190ce40545ac30 (diff) | |
| parent | 5bb70c14be426e4fac6f5aadf46a564cc23c5267 (diff) | |
Rollup merge of #66777 - GuillaumeGomez:tidy-err-codes, r=Mark-Simulacrum
Put back tidy check on error codes I just realized that the tidy checks were not run anymore on the error code long explanations. This add it back. cc @Dylan-DPC r? @Mark-Simulacrum
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/tidy/src/style.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index 5abe481368d..20636c86e1e 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -141,17 +141,28 @@ pub fn check(path: &Path, bad: &mut bool) { super::walk(path, &mut super::filter_dirs, &mut |entry, contents| { let file = entry.path(); let filename = file.file_name().unwrap().to_string_lossy(); - let extensions = [".rs", ".py", ".js", ".sh", ".c", ".cpp", ".h"]; + let extensions = [".rs", ".py", ".js", ".sh", ".c", ".cpp", ".h", ".md"]; if extensions.iter().all(|e| !filename.ends_with(e)) || filename.starts_with(".#") { return } + if filename.ends_with(".md") && + file.parent() + .unwrap() + .file_name() + .unwrap() + .to_string_lossy() != "error_codes" { + // We don't want to check all ".md" files (almost of of them aren't compliant + // currently), just the long error code explanation ones. + return; + } + if contents.is_empty() { tidy_error!(bad, "{}: empty file", file.display()); } - let max_columns = if filename == "error_codes.rs" { + let max_columns = if filename == "error_codes.rs" || filename.ends_with(".md") { ERROR_CODE_COLS } else { COLS |
