DEV Community

Discussion on: C# Linting and Formatting Tools in 2021

Collapse
 
binarypatrick profile image
BinaryPatrick

Love this post, thank you for all the research. Have you looked into any solutions adding this to a build pipeline or check in process? I'd really love to have an automated task in the PR to run this and commit styles changes to keep everything correct.

Collapse
 
srmagura profile image
Sam Magura

Thanks! The Johnny Reilly post I linked shows how to automate dotnet-format with a precommit hook. I don't think it will be possible to automate any of the other tools to the same extent.

Since SonarLint and StyleCop generate build warnings, you will see those warnings in CI. Here's a screenshot of a Sonar warning from my Azure Pipelines build:

Pipelines