-
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
Add FavourAsKeyword rule #709
Conversation
Thanks for your contribution! I'm going to do a quick review, but by the looks of it, most things are just going to be nitpicks; except one: please don't forget do add the new rule config entry in fsharplint.json: https://github.com/fsprojects/FSharpLint/blob/master/src/FSharpLint.Core/fsharplint.json |
""" | ||
|
||
Assert.AreEqual(expected, this.ApplyQuickFix source) | ||
this.AssertErrorWithMessageExists("Prefer using the as pattern to match a constant and bind it to a variable.") |
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.
@ribeirotomas1904 let's rather have two tests: one for the AssertErrorWithMessageExists and another one for the QuickFix
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.
done in 573f0e0
src/FSharpLint.Core/Text.resx
Outdated
</data> | ||
</data> | ||
<data name="RulesFavourAsKeyword" xml:space="preserve"> | ||
<value>Prefer using the as pattern to match a constant and bind it to a variable.</value> |
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.
@ribeirotomas1904 nit, let's wrap the word "as" with single-quotes, to make this more readable (otherwise at first glance it's hard to see that as
is meant to be read as a keyword)
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.
done in c985a31
Thanks for the feedback! config entry for the new rule added in 2f80c7e |
Add FavourAsKeyword rule and tests and docs for it.
Fixes #664