-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
join: remove a clippy::cognitive_complexity by moving some content in functions #5367
Conversation
src/uu/join/src/join.rs
Outdated
/// | ||
/// This function takes the matches from the command-line arguments, processes them, | ||
/// and returns a `Settings` struct that encapsulates the configuration for the program. | ||
fn parse_settings(matches: &clap::ArgMatches) -> UResult<Settings> { |
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.
Unfortunately, the refactorings are not enough and the cognitive_complexity
lint still shows a warning.
fn parse_settings(matches: &clap::ArgMatches) -> UResult<Settings> { | |
#[allow(clippy::cognitive_complexity)] | |
fn parse_settings(matches: &clap::ArgMatches) -> UResult<Settings> { |
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.
oh, maybe we should break the clippy task on this too
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.
Hm, what do you mean with "break the clippy task"? Currently, the lint still shows a warning.
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.
like this:
#5379
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.
Sorry, I still don't understand what you mean :| #5379 has been merged in the meantime and the CI shows an error for this PR (for some reason the job doesn't fail):
error: the function has a cognitive complexity of (12/10)
--> src/uu/join/src/join.rs:622:4
|
622 | fn parse_settings(matches: &clap::ArgMatches) -> UResult<Settings> {
6af3814
to
6dd08e9
Compare
Co-authored-by: Daniel Hofstetter <[email protected]>
No description provided.