csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

VSCode extension support local csharpier install

Open mcm-ham opened this issue 1 year ago • 3 comments

We're using megalinter https://megalinter.io/v6/descriptors/csharp_csharpier/ to ensure code is formatted however it requires developers to install the same version of csharpier that megalinter uses otherwise there's a mismatch. Being able to use local install would allow us to checkin the dotnet-tools.json file into source control so version is aligned without additional developer repo instructions.

Note we did try csharpier msbuild that would allow us to achieve our goal, however since it touches every file it breaks incremental build resulting in much longer rebuild times.

mcm-ham avatar Feb 13 '24 22:02 mcm-ham

Related #1036

mcm-ham avatar Feb 13 '24 22:02 mcm-ham

The vscode extension does support using a local version of csharpier. If you added the local version while vscode was open you may need to restart vscode.

For the msbuild version, all it does is run the csharpier tool. And the tool should only be modifying files that have formatting changes. I validated that with the latest version and from what I can tell in git, it has been that way since a very early version.

belav avatar Feb 14 '24 02:02 belav