Analyze naming rules#71
Merged
madskristensen merged 3 commits intomadskristensen:masterfrom Jun 14, 2019
Merged
Conversation
* Modifiers match before accessibility * 'const' always includes 'static' and 'readonly'
sharwell
commented
Jun 13, 2019
| <value>"{0}" is not a valid value for the "{1}" property</value> | ||
| </data> | ||
| <data name="NamingRuleReordered" xml:space="preserve"> | ||
| <value>Naming rule '{0}' was reordered relative to overlapping rule '{1}'. Elements which match both will be validated against rule '{0}' starting with Visual Studio 2019 version 16.3.</value> |
Collaborator
Author
There was a problem hiding this comment.
📝 This might actually be 16.2... will know for sure soon
sharwell
commented
Jun 13, 2019
| } | ||
| } | ||
|
|
||
| private bool Overlaps(in NamingRule x, in NamingRule y) |
Collaborator
Author
There was a problem hiding this comment.
🐛 This implementation doesn't currently handle cases where the ApplicableSymbolKindList and RequiredModifierList are mutually-exclusive. For example, it thinks the following two rules overlap:
- Members with the
asynckeyword are pascal case - Fields and locals are camelCase
Since there are no symbols which match both of these rules, it does not matter what order they appear in in the .editorconfig file. Therefore, we should not produce a warning.
I didn't fix this bug in the first pass since it will take some thought to make sure other bugs are not introduced. We can address it as a follow-up. Very few .editorconfig files will be impacted by this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The compiler implementation of .editorconfig changes the way naming rules are ordered. This pull request implements an analyzer to report a warning when the .editorconfig file contains two rules that will be evaluated in reverse order from their location in the .editorconfig file.
The warning emitted for this situation reads as follows: