-
Notifications
You must be signed in to change notification settings - Fork 926
Add recursive
config setting to appropriate tests
#4113
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
Comments
Hi, can I tackle this for my first time contributing rustfmt? |
Hi @Krout0n 👋 Thanks for your interest in contributing to rustfmt! @bradleypmartin is working on this one already (see #4142), but there are plenty of other issues in the backlog if you'd be interested in working on a different one, You may want to check out the issues that have been tagged with good-first-issue and/or those with help-wanted to see if you'd like to try any of those (though don't feel constrained to just those issues). If you find one that you want to work on just drop a note on that issue, and you can ask us any questions on that thread and/or in the wg-rustfmt channel on the Rust Discord server |
Seems this issues should have been closed by #4142 |
The list to add
|
@calebcartwright This issue seems completely done. 🎉 |
rustfmt 1.x ran in "recursive" mode by default wherein all the mods within the AST would be visited and formatted, including those mods defined in external files not explicitly passed as args to
rustfmt
.rustfmt 2.x inverts that behavior and will now only format files explicitly passed to
rustfmt
unless the--recursive
flag is passed (in which case rustfmt 2.x formats everything like rustfmt 1.x)As such a few of our test cases needed to be updated to explicitly include the
recursive
. Currently these tests are running in "non-recursive" mode and unintentionally ignoring some files which has resulted in a few false positves.This can be addressed by adding the below snippet to the top of the corresponding pairs of test files under
rustfmt-core/rustfmt-lib/tests/{source, target}/**
// rustfmt-recursive: true
Some (perhaps all) of the tests that need this change can be found by reviewing the skipped files in
rustfmt-core/rustfmt-lib/src/test/mod.rs
to determine the corresponding entry point files that needrecursive
enabled.rustfmt/rustfmt-core/rustfmt-lib/src/test/mod.rs
Lines 23 to 43 in a0eb97b
For example, we can see there's some test files within the
cfg_if
directory (rustfmt-core/rustfmt-lib/tests/{source,target}/cfg_if/mod.rs
that are being explicitly ignored to validate the target behavior, so the entry test file in this case (rustfmt-core/rustfmt-lib/tests/{source,target}/cfg_if/lib.rs
) needs to have recursive mode included by adding// rustfmt-recursive: true
This would be a good first issue for anyone interested in working on rustfmt!
The text was updated successfully, but these errors were encountered: