-
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
Cognitive Complexity PR, re-gitted #4516
Conversation
@vityafx I think this is much better now as a base. You should be able to base your work on it. It doesn't pass the |
@Manishearth there's a new
I'm guessing they're now being treated differently in the AST? What were the changes made to the (iirc there was work being done in the syntax so that one could chain if-lets together or something, right? Do you happen to know which RFC it was, and if it is that one that caused the change?) |
Yeah so now |
Ohh. And this is the documentation for
So, that |
yep |
Awesome, Manish, thank you. |
Btw I talked it over with Oliver and we've decided to keep this as close to the original paper as possible. Therefore syntax nodes that aren't sufficiently described there will not score at all. This is so as to make this PR as simple as possible, and to facilitate future expansions upon the lint. |
☔ The latest upstream changes (presumably #4523) made this pull request unmergeable. Please resolve the merge conflicts. |
Please go here to the lint's discussion, to see why I'm closing the PR 🙂 |
A continuation of the work done in #3963 due to git conflicts.
References:
Overall todo:
Remove the ICE described by Manish.
Decide if and how to score the constructs that are not being scored right now at all (most of them were not considered in the paper and so I thought that maybe there could be a default, low value, for non-specified kinds of expressions. Either do that, or just skip them for now and expand upon them in later versions).
Roll back the implementation of flexible scores (done in one of the last commits of the original PR). This is because we want to keep this PR as simple as possible, and steering too far out of where the paper scores things will make future expansions harder to do in the right direction. For now, the minimal, the better.
Write the complete specification for what's been implemented (the Draft should be a good base, and the original paper should be used as a reference). This should end up in the docs directory of Clippy, I think.
Finish writing up test cases and tidy up the test folder for this lint.
Overall already done: