-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
lintcheck: use multithreading unless --fix or --recursive is used #10458
Conversation
r? @dswij (rustbot has picked a reviewer for you, use r? to override) |
r? @llogiq |
I don't think we need an |
lintcheck/src/config.rs
Outdated
config.max_jobs = Some(if config.fix || config.recursive { | ||
1 | ||
} else { | ||
std::thread::available_parallelism().map_or(1, |n| n.get()) | ||
}); |
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.
Why not make config.max_jobs
a plain usize
with a #[default = 0]
and then first set it to 1
if config.fix || config.recursive
, then if it is still zero, set it to available_parallelism
if available, 1 otherwise?
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.
Indeed. Done.
d33e140
to
a701af4
Compare
Thank you! @bors r+ |
lintcheck: use multithreading unless --fix or --recursive is used Use multithreading unless there is a reason not to.
💔 Test failed - checks-action_test |
@llogiq: I have added the missing "changelog: none" in the PR description |
Thanks! @bors r+ |
💡 This pull request was already approved, no need to approve it again.
|
lintcheck: use multithreading unless --fix or --recursive is used Use multithreading unless there is a reason not to. changelog: none
💔 Test failed - checks-action_test |
Seems like a transient error @bors retry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Use multithreading unless there is a reason not to.
changelog: none