TL;DR - Is there an Azure DevOps pipeline task for formatting code as part of the build process? I have not been able to find one and would really find it useful.
My team uses the free CodeMaid Visual Studio extension to "beautify" (format) C# code. While the extension works well, there are several limitations to relying on developers to format their own code in Visual Studio:
- Developers constantly forget to run the tool.
- Enabling "Automatically run file clean-up on save" can be frustrating to use while code is being worked as it reorganizes code which might break one's train-of-thought.
- Developers can change the format settings to their own liking instead of abiding by the formatting standard of the team which can cause code merge issues and formatting wars.
I think a much better solution would be to have a pipeline task in Azure DevOps that ran a tool like Code Maid as part of the build process. This would ensure that no code gets into source control in an ugly, unformatted state and would ensure that all code is formatted to whatever standard is enabled as part of the build.