You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the root directory I have .csharperrc.yaml which specifies the line length as 120.
Also, in the root directory I have .editorconfig which doesn't specify the line length.
In subdirectory A I have an .editorconfig which doesn't specify the line length either. (Note it also does not have root = true)
When I run dotnet csharpier . in the root directory, all the files in A get formatted with line length 100 (the default).
I expected the line length in the root .csharpierrc.yaml to be used, but it only does this when the A/.editorconfig doesn't exist.
I've now added max_line_length = 120 to the root .editorconfig and it works, but this was a surprise when upgrading to 0.26.
The text was updated successfully, but these errors were encountered:
Starting from the directory for a given file being formatted
If the current directory contains a .csharpierrc use that
Else if the current directory contains a .editorconfig use that. Take into account any .editorconfig files in parent folders until root = true is found
Else move up to the parent directory and repeat
I'm thinking there are two possible fixes.
If there is a .csharpierrc in or above the file being formatted, that will take priority over any .editorconfig file.
In the case where an .editorconfig is found, merge the settings from it with the first .csharpierrc file that is found above a given .editorconfig
The first option is definitely easier to implement and also a lot easier to understand how it works. It seems like the correct way to handle this.
In the root directory I have
.csharperrc.yaml
which specifies the line length as 120.Also, in the root directory I have
.editorconfig
which doesn't specify the line length.In subdirectory
A
I have an.editorconfig
which doesn't specify the line length either. (Note it also does not haveroot = true
)When I run
dotnet csharpier .
in the root directory, all the files inA
get formatted with line length100
(the default).I expected the line length in the root
.csharpierrc.yaml
to be used, but it only does this when theA/.editorconfig
doesn't exist.I've now added
max_line_length = 120
to the root.editorconfig
and it works, but this was a surprise when upgrading to 0.26.The text was updated successfully, but these errors were encountered: