Is there a lint-like tool for C#? I've got the compiler to flag warnings-as-errors, and I've got Stylecop, but these only catch the most egregious errors. Are there any other must-have tools (especially for newbie C#ers like me) that point out probably-dumb things I'm doing?
Linting is the automated checking of your source code for programmatic and stylistic errors. This is done by using a lint tool (otherwise known as linter). A lint tool is a basic static code analyzer. The term linting originally comes from a Unix utility for C.
The term linter comes from a tool originally called “lint” that analyzed C source code. The computer scientist Stephen C. Johnson developed this utility in 1978 when he worked at Bell Labs.
So what is linting? lint, or a linter, is a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs.
Definition of linter 1 : a machine for removing linters. 2 linters plural : the fuzz of short fibers that adheres to cottonseed after ginning.
Tried FxCop? It's integrated into VS as "Code Analysis"
In the newer versions of Visual Studio, it is called "Microsoft Code Analysis" and can be downloaded from the Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.MicrosoftCodeAnalysis2017
Resharper performs a fair bit of static analysis as well as doing a ton of other useful things. Since version 8.0 analysis can run in command line mode. Currently I wouldn't code in C# without it.
As well as FxCop, Gendarme is another tool to look at (it is Mono's version of FxCop but they are different in approach and the errors that they actually find).
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