Is there any tool witch allows to apply fix for all VS2017 messages like "IDE1006 Naming rule violation: These words must begin with upper case characters"?
In VS2017 it has to be done manually one by one, it shouldn't be hard to add such feature in IDE since all elements are listed. I tried to find solution in Resharper but despite of its vast functionallity in matter of naming styles I didn't find what I was looking for.
But a solution or a project can override these rules, so that everyone who works on the solution/project is using the same rules, no matter what they have configured in Visual Studio. To configure these rules, you use an .editorconfig file.
In your Visual Studio instance, you can configure the default rules in the options. But a solution or a project can override these rules, so that everyone who works on the solution/project is using the same rules, no matter what they have configured in Visual Studio. To configure these rules, you use an .editorconfig file.
In Visual Studio, go to Tools->Options, and in the Options Window navigate to Text Editor – C# – Code Style – Naming as you see it in the screenshot below: There you can see a few rules of Visual Studio. Click on the Manage naming styles button.
There you can see a few rules of Visual Studio. Click on the Manage naming styles button. This opens up this little Window: There you click on the green plus to add a new naming style.
Here is the solution. Resharper allows you to create custom naming rules in Options/CodeEditing/C#/NamingStyle go to Advenced Settings and add your custom rule. In my case I wanted to fix lowercase event names to Uppercase. I failed before because even though i selected UpperCamelCase_UndescoreTollerant for events Resharper didn't find any naming violations after CleanUp Code.
To make CleanUp Code find it one more thing is needed to be done.
The field Event subscriptions on fields is by default $object$$event$, but it has to be changed to *$:Luobject$$event$* (:Lu - Regex First Character Uppercase)
Resharper after CleanUp Code allows you to fix naming by select event, click the light bulb and apply for a document/project/solution.
Screen
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With