sdk
sdk copied to clipboard
Dotnet format should take a single file
Description of the problem
Dotnet format is fantastic. We use it to check all the .editorconfig rules have been followed in our builds.
But really I want a version of prettier that I have for Typescript. So that I can run dotnet format on the open file every time I press 'Save', and so I could run it on just modified files as a pre-commit hook (rather than having to run it on the whole solution).
Describe the solution I'd like
dotnet format [filename|filename list|file glob pattern].
Similar to https://github.com/dotnet/sdk/issues/42713
Somebody mentioned the --include flag - I don't think this is good enough, it still requires you to specify a project/solution. I'm naive to the reason for this, but I assume it's to help with import solution or something like that. If that's the case, that doesn't seem like a great reason. prettier for example can operator on a single tsx/jsx without knowledge of the rest of the project as far as I'm aware, and I think it would be a great feature to have with dotnet format, too
Somebody mentioned the
--includeflag - I don't think this is good enough, it still requires you to specify a project/solution. I'm naive to the reason for this, but I assume it's to help with import solution or something like that. If that's the case, that doesn't seem like a great reason. prettier for example can operator on a single tsx/jsx without knowledge of the rest of the project as far as I'm aware, and I think it would be a great feature to have with dotnet format, too
I tried the --include, it scan all the solution then do your file for example on a project I have it take 2 minutes with one file include cause it scan all the files