join: remove a clippy::cognitive_complexity by moving some content in functions#5367
Merged
cakebaker merged 2 commits intouutils:mainfrom Oct 16, 2023
sylvestre:join
Merged
join: remove a clippy::cognitive_complexity by moving some content in functions#5367cakebaker merged 2 commits intouutils:mainfrom sylvestre:join
cakebaker merged 2 commits intouutils:mainfrom
sylvestre:join
Conversation
cakebaker
reviewed
Oct 7, 2023
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> { |
Contributor
There was a problem hiding this comment.
Unfortunately, the refactorings are not enough and the cognitive_complexity lint still shows a warning.
Suggested change
| fn parse_settings(matches: &clap::ArgMatches) -> UResult<Settings> { | |
| #[allow(clippy::cognitive_complexity)] | |
| fn parse_settings(matches: &clap::ArgMatches) -> UResult<Settings> { |
Contributor
Author
There was a problem hiding this comment.
oh, maybe we should break the clippy task on this too
Contributor
There was a problem hiding this comment.
Hm, what do you mean with "break the clippy task"? Currently, the lint still shows a warning.
Contributor
There was a problem hiding this comment.
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> {
cakebaker
reviewed
Oct 7, 2023
cakebaker
reviewed
Oct 16, 2023
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
cakebaker
approved these changes
Oct 16, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.