-
-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to run dotnet-format with --fix-style CLI argument? #1642
Comments
I am struggling to find official documentation on |
Maybe we should switch all "file by file" linters into project mode by default... :) |
When |
I use incremental run on none of my projects, I want legacy-not-updated code to also be checked everytime with latest versions of linters 👿 |
But yes we could something like "if incremental then file by file, else project mode" :) |
Yea, dotnet-format's documentation isn't very clear/consistent, I'm just trying to figure it out myself. Good thing is I think I did, I'll explain what I found out later in this post. About CSharpier, I haven't played with it yet. It seems sleek and nice. Why not open a feature request for adding this linter? The thing is it uses dotnet 6.0 and I think MegaLinter is currently running on dotnet 5.0.
Maybe you should, but I'm not sure it would be necessary. What I think is needed is to leave out the With dotnet 5.0 the command should be: and with dotnet 6.0 (which is not the case for MegaLinter, but should you upgrade it someday): btw, For example, let's say I have this file structure:
On dotnet 5.0 if I'm executing commands from But since As you can see the If I were running the command on Now for incremental run you could use the In dotnet 5.0 file path should be relative to workspace. Only Now, as for dotnet 6.0 the So:
And last but not least, as with the dotnet 5.0, if I were running the command on
|
@Kurt-von-Laven it seems CSharpier only apply whitespaces fixes and such. When using dotnet-format with Those are specified here and you can play with Visual Studio to make it generate a file with those settings for you in Also, in the |
MegaLinter works best with list_of_files, and I like to have latest versions of platforms, so I try some things in this PR -> #1646 |
I think you forgot to remove the |
@nvuillam Oh well, you might want to check out this issue from dotnet format repo. It looks like the default linter now requires a With that you might want to ignore my PR comment telling you to remove the Unfortunately that doesn't solve this issue as using the ====== A more complete solution would be: Have a variable Have a variable Have it so that when a value is set for Just for review, the command should be: The default would be to run as a If CSHARP_DOTNET_FORMAT_LINT_MODE: style
CSHARP_DOTNET_FORMAT_CLI_WORSKPACE: "./" which give us: If CSHARP_DOTNET_FORMAT_LINT_MODE: none
CSHARP_DOTNET_FORMAT_CLI_WORSKPACE: "./" which give us: Sorry for all this inconvenience, I would make a PR myself but I'm not familiarized enough with your repo (nor python). PS: I used Edit: A clever solution would be to make |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
Similar to #1994. |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
@lextatic is this issue still relevant after your dotnet v6 PR ? |
It's not. With the upgrade dotnet-format v6 defaults to linting with style included. |
Thanks for the feedback :) |
I want to lint C# with Naming rules. That would be possible if I could use the parameter
--fix-style
with the MegaLinter'sdotnet-format
(dotnet 5.0). Unfortunately this doesn't seem to work because I think the default command is always executed with the--folder
parameter which is mutually exclusive with the--fix-style
parameter.--fix-style
needs to run considering a workspace.--folder
runs for individual files.Am I missing something? Is this even possible? Should I open a feature request?
The text was updated successfully, but these errors were encountered: