Skip to content
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

Downgrade cognitive_complexity to nursery #5428

Merged
merged 1 commit into from Apr 8, 2020

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Apr 6, 2020

As discussed in #5418 (comment); Clippy's current understanding of cognitive complexity is not good enough yet at analyzing code for understandability to have this lint be enabled by default.

changelog: Remove cognitive_complexity from default set of enabled lints

@flip1995 flip1995 added the S-waiting-on-bors Status: The marked PR was approved and is only waiting bors label Apr 6, 2020
@felix91gr
Copy link
Contributor

felix91gr commented Apr 7, 2020

Wow, you're so fast! ✨

I came here to comment on this little thing, because in my original comment I was definitely a bit ambiguous:

Clippy's current understanding of cognitive complexity is not good enough yet

I'm guessing this comes from me at #5418:

we're not good enough yet at analyzing code for understandability.

Sorry for being so unclear!

I meant we as in, the computer science and software development community. We just don't know how to properly quantify cognitive complexity (in the conversation quoted at #5418 I went into more detail). That's why no tools, not even Clippy, are able to give a satisfying, or generally useful, answer to the question of "Is this function/file/impl too complex?"

@flip1995
Copy link
Member

flip1995 commented Apr 7, 2020

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 7, 2020

📌 Commit 2fe98cc has been approved by flip1995

@bors
Copy link
Collaborator

bors commented Apr 7, 2020

🌲 The tree is currently closed for pull requests below priority 2, this pull request will be tested once the tree is reopened

bors added a commit that referenced this pull request Apr 8, 2020
Rollup of 12 pull requests

Successful merges:

 - #5345 (Add lint for float in array comparison)
 - #5406 (Fix update_lints)
 - #5409 (Downgrade let_unit_value to pedantic)
 - #5410 (Downgrade trivially_copy_pass_by_ref to pedantic)
 - #5412 (Downgrade inefficient_to_string to pedantic)
 - #5415 (Add new lint for `Result<T, E>.map_or(None, Some(T))`)
 - #5417 (Update doc links and mentioned names in docs)
 - #5419 (Downgrade unreadable_literal to pedantic)
 - #5420 (Downgrade new_ret_no_self to pedantic)
 - #5422 (CONTRIBUTING.md: fix broken triage link)
 - #5424 (Incorrect suspicious_op_assign_impl)
 - #5425 (Ehance opt_as_ref_deref lint.)

Failed merges:

 - #5411 (Downgrade implicit_hasher to pedantic)
 - #5428 (Move cognitive_complexity to nursery)

r? @ghost

changelog: rollup
bors added a commit that referenced this pull request Apr 8, 2020
Rollup of 11 pull requests

Successful merges:

 - #5406 (Fix update_lints)
 - #5409 (Downgrade let_unit_value to pedantic)
 - #5410 (Downgrade trivially_copy_pass_by_ref to pedantic)
 - #5412 (Downgrade inefficient_to_string to pedantic)
 - #5415 (Add new lint for `Result<T, E>.map_or(None, Some(T))`)
 - #5417 (Update doc links and mentioned names in docs)
 - #5419 (Downgrade unreadable_literal to pedantic)
 - #5420 (Downgrade new_ret_no_self to pedantic)
 - #5422 (CONTRIBUTING.md: fix broken triage link)
 - #5424 (Incorrect suspicious_op_assign_impl)
 - #5425 (Ehance opt_as_ref_deref lint.)

Failed merges:

 - #5345 (Add lint for float in array comparison)
 - #5411 (Downgrade implicit_hasher to pedantic)
 - #5428 (Move cognitive_complexity to nursery)

r? @ghost

changelog: rollup
@bors
Copy link
Collaborator

bors commented Apr 8, 2020

☔ The latest upstream changes (presumably #5438) made this pull request unmergeable. Please resolve the merge conflicts.

@flip1995
Copy link
Member

flip1995 commented Apr 8, 2020

@dtolnay a rebase is required after the rollup #5438

@flip1995
Copy link
Member

flip1995 commented Apr 8, 2020

@bors treeclosed- (shamelessly using this PR to reopen the tree again)

@bors
Copy link
Collaborator

bors commented Apr 8, 2020

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout cognitive (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self cognitive --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging tests/ui/if_same_then_else2.stderr
Auto-merging tests/ui/if_same_then_else2.rs
Auto-merging tests/ui/debug_assert_with_mut_call.rs
CONFLICT (content): Merge conflict in tests/ui/debug_assert_with_mut_call.rs
Auto-merging src/lintlist/mod.rs
Auto-merging clippy_lints/src/types.rs
Auto-merging clippy_lints/src/methods/mod.rs
Auto-merging clippy_lints/src/lib.rs
Automatic merge failed; fix conflicts and then commit the result.

@dtolnay
Copy link
Member Author

dtolnay commented Apr 8, 2020

Rebased.

@flip1995
Copy link
Member

flip1995 commented Apr 8, 2020

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 8, 2020

📌 Commit 899a1b5 has been approved by flip1995

@bors
Copy link
Collaborator

bors commented Apr 8, 2020

⌛ Testing commit 899a1b5 with merge 7bfdee5...

@bors
Copy link
Collaborator

bors commented Apr 8, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 7bfdee5 to master...

@bors bors merged commit 7bfdee5 into rust-lang:master Apr 8, 2020
@dtolnay dtolnay deleted the cognitive branch April 8, 2020 17:58
@dtolnay dtolnay changed the title Move cognitive_complexity to nursery Downgrade cognitive_complexity to nursery May 14, 2020
SingingTree added a commit to SingingTree/mp4parse-rust that referenced this pull request Jan 21, 2021
Since these allow lines were added, this clippy lint has been downgraded
to a nursery check via
rust-lang/rust-clippy#5428

Since we don't have allows for other nursery lints, I suggest we remove
these ones.
SingingTree added a commit to SingingTree/mp4parse-rust that referenced this pull request Jan 21, 2021
Since these allow lines were added, this clippy lint has been downgraded
to a nursery check via
rust-lang/rust-clippy#5428

Since we don't have allows for other nursery lints, I suggest we remove
these ones.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: The marked PR was approved and is only waiting bors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants