roslynator icon indicating copy to clipboard operation
roslynator copied to clipboard

Quick start guide

Open marcospgp opened this issue 4 years ago • 3 comments
trafficstars

I installed the VSCode extension after looking for something that would enforce a style for my project's code, but I have found the documentation to be lacking in terms of how to get started with the package.

It seems that rules are being enforced by default? How do I see which? The file roslynator.ruleset doesn't seem to specify any.

What is the difference between the different possible values for Action? `"None,Hidden,Info,Warning,Error"

I've checked the documentation and still am not sure how to configure the rules for my project, or where to look for a list of these rules, or how to apply refactors, etc.

Thanks!

Edit: Since the line <!-- <Include Path="" Action="Default,None,Hidden,Info,Warning,Error" /> --> is commented out below, shouldn't there be no active rules by default??

image

Yet I am getting warnings:

image

marcospgp avatar Dec 10 '20 18:12 marcospgp

Another question: Is there a way to enable these analyzers?

https://github.com/microsoft/Microsoft.Unity.Analyzers

marcospgp avatar Dec 11 '20 12:12 marcospgp

Documentation related to Roslynator is here: https://github.com/JosefPihrt/Roslynator/blob/master/docs/AnalyzersVsRefactorings.md https://github.com/JosefPihrt/Roslynator/blob/master/docs/HowToConfigureAnalyzers.md https://github.com/JosefPihrt/Roslynator/blob/master/docs/HowToConfigureRulesetFile.md https://github.com/JosefPihrt/Roslynator/blob/master/docs/HowToCustomizeRulesForProject.md

List of analyzers is here ('None' means that the analyzer is disabled by default): https://github.com/JosefPihrt/Roslynator/tree/master/src/Analyzers https://github.com/JosefPihrt/Roslynator/tree/master/src/CodeAnalysis.Analyzers https://github.com/JosefPihrt/Roslynator/tree/master/src/Formatting.Analyzers

Documentation related to code analysis generally is here (I used Google to find it): https://docs.microsoft.com/en-us/visualstudio/code-quality/roslyn-analyzers-overview?view=vs-2019 https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2019

To your second comment: please ask them.

josefpihrt avatar Dec 12 '20 15:12 josefpihrt

The issue is that, as you showed, the documentation is a little scattered - and it's not easy to get a quick start with the package.

The comments in the configuration file are not very clear, especially since at first sight it would seem that no analyzers would be enabled by default, which isn't the case.

In my opinion it would be better to have a tutorial on how to set up Roslynator on Visual Studio Code without using the extension, so that it is easier to have it working alongside other sets of analyzers - such as the Unity one I mentioned above.

I believe the idea is basically what I wrote here, except one would download Roslynator's .dlls instead of Microsoft's.

marcospgp avatar Dec 12 '20 16:12 marcospgp