-
Notifications
You must be signed in to change notification settings - Fork 931
fix self_tests #4033
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
fix self_tests #4033
Conversation
@@ -92,7 +92,6 @@ struct Opt { | |||
verbose: bool, | |||
|
|||
// Nightly-only options. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to keep the intent of this comment (and the Positional args
on line 125/126 below) separate so they don't seem to be pinned to a specific opt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now rustfmt removes the newline in this case.
So if I insert newline here, self_tests is failed...
I think this is the rustfmt bug.
maybe related: #4012
@@ -385,7 +389,8 @@ fn self_tests() { | |||
if !is_nightly_channel!() { | |||
return; | |||
} | |||
let mut files = get_test_files(Path::new("tests"), false); | |||
let skip_file_white_list = ["target", "tests"]; | |||
let mut files = get_test_files(Path::new("../../rustfmt-core"), true, &skip_file_white_list); | |||
files.push(PathBuf::from("src/lib.rs")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I was also originally thinking that we could restore self_tests
by conditionally enabling the recursive
Config setting that could be controlled via additional flags to check_files()
and then to idempotent_check()
vs. running in non-recursive mode and collecting each individual file.
However, if we are going to use the updated form of get_test_files
to collect every file, then I don't think there's a need to have this line to push the entry lib.rs
file again (it should already be there), right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly. I fixed it. Thank you for the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
fix: #4017