-
Notifications
You must be signed in to change notification settings - Fork 467
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
Ideas for resources (resx) analyzers #3525
Comments
Regarding keys, for rules with different messages, the current pattern is The analyzer could also be checking for |
@Evangelink - do you think the rule for keys would be possible to enforce? Do we foresee resource strings outside these 4 buckets? The core concern for me is that it would not be possible to add a source suppression for these cases as it is defined in a resx file. |
@Evangelink - I'd say lets start with the analyzer that enforces what you suggested for rule values for now. |
@mavasani What about reporting on calling site instead of resource definition? |
Ah, that seems to be a good idea :) Please do add a good description, and if possible a code fix. I am presuming you would anyways need such an analyzer to require the resx file passed in as an additional file so you can have code fixes that automatically fix the issue instead of manual fixes. |
@Evangelink Feel free to get started here. Note that analysis of resx files is a pretty desired bucket of rules. For example, finding duplicate resx strings, flagging unused resx strings, etc. would be super helpful as well. |
@mavasani It'd be nice if we could define the next steps for this analyzer, it seems to be pretty important. |
Yeah, hoping to get to it this week... |
Closes dotnet#3525 Adds a code fix for RS1031, RS1032 and RS1033 Additionally, if the resx file with analyzer resource strings is provided as an additional file to the analyzer, also validates the strings in the resx file.
Add a new analyzer for roslyn-analyzers that will check for resources keys and values.
Rules for keys
Title
,Message
,Description
orCodeFixTitle
.Rules for values
If the value is linked to a title or message key, then it shouldn't end with a period '.'.
If the value is linked to a description, it should end with a period '.'.
Placeholders should be surrounded with single-quotes.
Tagging @mavasani for other ideas.
The text was updated successfully, but these errors were encountered: