Add a stock Azure DevOps pipeline stage to run dotnet-format
I'm looking at running dotnet-format --check on all our PRs. The simplest result is just to fail if it returns an error and tell the user to run dotnet-format, but this seems like a common enough thing that it would be worth trying to add to Azure DevOps with integration where it adds inline comments where there are formatting errors.
@mikadumont I think this aligns with things you were designing
Could this possibly include an option to not produce inline comments but instead write a file that can be used to produce inline comments? For example, a list of: File name, starting line, ending line, expected new code (and possibly incorrect old code, if we're thinking Diff hunks) - either in JSON, XML, or whatever machine-readable format that isn't necessarily a plain Diff/Patch.
Reason being is that we use Azure DevOps for CI, but Code Hosting is done elsewhere (which does support inline code comments, but seems infeasible to support in a stock task when there are many ways of using this information, like in GitHub, GitLab, Bitbucket, etc. - both as commit comments and Pull Request/Merge Request comments).
@BhaaLseN Having the tool produce a tool agnostic output and then doing the parsing and integration of it in each tool seems like an excellent idea to me. Then create a stock task for ADO and GH that parses that file.
FYI: the --report option seems to be a suitable basis for this. At least it produces a JSON file that can be read by something else and has enough information to get the file path, line number and character number to potentially generate a comment on the offending source file.