Stylecopanalyzers: CLI?

Created on 1 Dec 2017  路  10Comments  路  Source: DotNetAnalyzers/StyleCopAnalyzers

Does StyleCop.Analyzers have a command-line interface? Can it be run via the msbuild command-line even? This would be especially useful on Mono, where there is no code analysis integration in Xamarin Studio.

enhancement question

Most helpful comment

I agree having a proper CLI would be terrific, especially when it comes to CI.

All 10 comments

Used as a nuget package, it integrates into the build. No CLI needed.

You say "needed", but actually a CLI is sometimes desirable over integration... in this case though, I have since learnt that you cannot do the static analysis without building (which is rather odd)... so I guess this is a no-go.

Well its a roslyn based analyzer, it has to build to do its work, since roslyn is a compiler.

Out of curiousity, in what scenario would a CLI be more useful than an integration?

Need not perform every stage of the build though, I was thinking.

Would be more useful for automation, e.g. CI. With some MSBuild parameters though (I have a separate issue on that), this issue could be alleviated.

I agree having a proper CLI would be terrific, especially when it comes to CI.

Having a CLI utility would be amazing to work both with CI but also as git commit hook.

Agree with the comments above.
Currently we have an issue: we are going to support legacy solution (23 project) and it has over 30K warnings. I thought, it would be super if we could run StyleCop for only those single file that were updated to fix warnings. Maybe, it's possible, but I has to integrate it with CI and I didn't find any possible solutions to lint a file, except pressing on the button 'Run StyleCop' in the VS2017.

Is this still true? I'm helping maintain client libraries / bindings in many different languages: ruby, python, js, java, kotlin, and c#. As part of this project, I'm shelling out to various language specific cli tools for linting snippets of code for documentation. Would love any pointers for running StyleCop against my c# snippets from the CLI (mac/unix)

Hey maintainers, any thoughts about this issue after years of silence?

I found this but didn't get around to trying it.

https://github.com/kzu/AutoCodeFix

Was this page helpful?
0 / 5 - 0 ratings

Related issues

batwad picture batwad  路  5Comments

MartyIX picture MartyIX  路  5Comments

iron9light picture iron9light  路  4Comments

vweijsters picture vweijsters  路  3Comments

DirtyPiece picture DirtyPiece  路  7Comments