-
Notifications
You must be signed in to change notification settings - Fork 73
DRAFT: Add DisallowShadowing rule #676
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
base: master
Are you sure you want to change the base?
DRAFT: Add DisallowShadowing rule #676
Conversation
d25dadd to
f349def
Compare
|
@webwarrior-ws please add a test for shadowing for variables that start with underscore: in this case we don't want the rule to flag them. |
Added new commit with test and changes to the rule code. |
|
@webwarrior-ws let's rebase this again sorry. |
1fb6cc1 to
29b6c28
Compare
Nevermind, I just did it myself. However, I didn't manage to fix the build entirely so please continue adding commits here. Thanks |
a156b0f to
b7928b7
Compare
Added DisallowShadowing rule (no implementation yet). Added tests for it.
Implemented DisallowShadowing rule, making previously added tests pass. Fixes fsprojects#112
In DisallowShadowing rule, ignore variables that start with underscore (`_`). Added test for this case.
Co-authored-by: webwarrior-ws <reg@webwarrior.ws>
ac41076 to
a52ab0c
Compare
|
Not sure the rule is working well, it seems to be flagging as a violation when two functions have parameters with the same name (look at my last WIP commit that I just pushed). |
I've noticed that too and added a test case for it. |
That makes sure that there is no false positive when different non-nested functions have the same parameter name.
Utilities.rangeContainsOtherRange only took line numbers into account, changed it to compare both line and column numbers.
3a608c6 to
823cbe1
Compare
That makes sure that there is no false positive for the same identifier in match clause used multiple times that doesn't shadow another identifier.
aa5d2be to
2523523
Compare
In match expressions.
2523523 to
89d1aa5
Compare
That makes sure that there is no false positive for identifiers used as arguments to active pattern.
In match expressions with active pattern.
a8be63b to
3b7b887
Compare
e17c16f to
9226ca3
Compare
9226ca3 to
4a7b5ef
Compare
Add DisallowShadowing rule and tests for it.
Fixes #112