-
Notifications
You must be signed in to change notification settings - Fork 73
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
Rule that suggest using auto-property #625
Rule that suggest using auto-property #625
Conversation
ec25c30
to
fb72d73
Compare
src/FSharpLint.Core/Rules/Conventions/SuggestUseAutoProperty.fs
Outdated
Show resolved
Hide resolved
@webwarrior-ws can you rebase this please? |
@webwarrior-ws also update the Introduced in... text. |
17cb08b
to
4c93a90
Compare
@knocte rebased |
|
||
let rule = | ||
{ Name = "SuggestUseAutoProperty" | ||
Identifier = Identifiers.FavourConsistentThis |
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.
@webwarrior-ws this is a typo here, please fix
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.
Fixed
Add a rule that suggest usage of auto-property for property with getter that only returns some (immutable) value. Add tests for it. Co-authored-by: Mehrshad <code.rezaei@gmail.com>
Implement rule introduced in previous commit and make it pass the tests. Co-authored-by: Mehrshad <code.rezaei@gmail.com>
Added 2 more tests: for porperty returning literal value and for property returing mutable variable.
Check if returned value is a mutable variable, and only return warning if it's not. Makes test added in previous commit green.
Update configuration and docs to include SuggestUseAutoProperty rule.
Added tests for cases when property returns array or list of immutable values.
Make rule pass tests introduced in previous commit by checking if poperty returns list or array of immutable values.
Added test that checks that rule is not applied to static properties.
Make rule pass test introduced in previous commit by checking if poperty is static or instance property.
Added a test for suggested fix.
Implement quick fix suggestion for the rule.
Added unit tests where `__` and `this` is used (instead of self).
Addressed comments to the PR.
1702015
to
fba8714
Compare
Add rule that suggests usage of auto-property (
member val Foo
) whenmember self.Foo
is unnecessary.Fixes #596.