Skip to content
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

What are the defaults for severity? #1449

Open
sander1095 opened this issue Dec 2, 2021 · 4 comments
Open

What are the defaults for severity? #1449

sander1095 opened this issue Dec 2, 2021 · 4 comments
Labels
Question This issue is requesting information about dotnet-format

Comments

@sander1095
Copy link

When I run dotnet format, I can also specify severity (info, warn, error).

Let's say I have a normal editorconfig (dotnet new editorconfig)

This is a bit confusing to me.

What is the default severity behavior if all I do is dotnet format?

@JoeRobich
Copy link
Member

@sander1095 Thanks for opening this issue. The default severity in the 6.0 release was changed to "warn". I will look at getting our documentation updated to make this more clear.

@JoeRobich JoeRobich added the Question This issue is requesting information about dotnet-format label Dec 2, 2021
@sander1095
Copy link
Author

So info and error are never run by default then?

Perhaps it would be good to explain "why" in the documentation as well.

I am also having a very difficult time finding a good editorconfig for dotnet. Perhaps this tool could work together with dotnet new editorconfig to create one? The dotnet command creates one but is pretty barebones to popular ones like the roslyn one, or the one from https://github.com/RehanSaeed/EditorConfig.

I would like one that is fully up to date with all the standards, provides good warnings and also provides some docs on why popular things are configured that way and how to perhaps disable them. For example, adding missing switch cases to an existing project is something you might not want?

Perhaps I am just rambling here, but that is kind of the result of such an unclear environment about this subject.

@JoeRobich
Copy link
Member

So info and error are never run by default then?

@sander1095 The severity is a minimum severity, so warnings and errors would be fixed when dotnet format is run.

I am also having a very difficult time finding a good editorconfig for dotnet.

I am partial to dotnet-format's .editorconfig, which is just a slightly modified Roslyn .editorconfig. The Runtime .editorconfig is another good one.

I would like one that is fully up to date with all the standards, provides good warnings and also provides some docs on why popular things are configured that way and how to perhaps disable them.

I think that would be great for the community. It could even publish it as a dotnet template for use with the CLI. Here is a link to our documentation which breaks up the rules into different categories with descriptions - https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options

@jmarolf
Copy link
Contributor

jmarolf commented Dec 3, 2021

The dotnet command creates one but is pretty barebones

the .editorconfig that you get on dotnet new comes from here so we can certainly submit PRs to update to whatever we think is best. By default, I had it match all Visual Studio settings.

I don't know I would describe the one created by dotnet new as barebones personally. It clocks in at 364 lines which is bigger than roslyn or the runtimes editorconfig files but certainly not the 448 lines of https://github.com/RehanSaeed/EditorConfig/blob/main/.editorconfig. There are individual analyzers that you could add entries for but in my opinion the defaults should not require you to do that. Analyzer severities should be correct as-is with you only needing to override a select few.

I would like one that is fully up to date with all the standards,

There is a little bit of discussion about that over here: dotnet/templating#4126 we definitely want a way for you to get new options when they ship. Haven't finalized a plan for that yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question This issue is requesting information about dotnet-format
Projects
None yet
Development

No branches or pull requests

3 participants