-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #65630 - ecstatic-morse:graphviz-tidy, r=Mark-Simulacrum
Check all files in `src/test` for `borrowck_graphviz_postflow` This attribute causes DOT files to be generated in the top-level directory. It is intended to be used only temporarily and should never appear on master. This also tells git to ignore DOT files in the root or the `mir_dump` directory, which `-Z dump-mir` uses by default. This will prevent #65071 from occurring again. It needs to be merged after #65629, otherwise `tidy` will start failing. r? @Mark-Simulacrum
- Loading branch information
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//! Tidy check to prevent creation of unnecessary debug artifacts. | ||
use std::path::{Path, PathBuf}; | ||
|
||
const GRAPHVIZ_POSTFLOW_MSG: &'static str = | ||
"`borrowck_graphviz_postflow` attribute in test"; | ||
|
||
pub fn check(path: &Path, bad: &mut bool) { | ||
let test_dir: PathBuf = path.join("test"); | ||
|
||
super::walk(&test_dir, &mut super::filter_dirs, &mut |entry, contents| { | ||
let filename = entry.path(); | ||
let is_rust = filename.extension().map_or(false, |ext| ext == "rs"); | ||
if !is_rust { | ||
return; | ||
} | ||
|
||
for (i, line) in contents.lines().enumerate() { | ||
if line.contains("borrowck_graphviz_postflow") { | ||
tidy_error!(bad, "{}:{}: {}", filename.display(), i + 1, GRAPHVIZ_POSTFLOW_MSG); | ||
} | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters