Comments (5)
Hey, I wonder what should be the convention to prevent the formatting because from my understanding of editor configs they work in the way so that the ones in child directories can override the settings defined in root directory. So that if setting a=true
was defined in root then in child if you specify a=false
it'll be false for all files in that child directory. If it's empty then it should be true. That's how it supposed to work at least according to my understanding.
Edit:
Copied from https://editorconfig.org/#file-location :
EditorConfig files are read top to bottom and the most recent rules found take precedence. Properties from matching EditorConfig sections are applied in the order they were read, so properties in closer files take precedence
from format.
Visual Studio respects that editorconfig and formatting within that directory applies no changes because it doesn't respect VS default formatting preferences when an editorconfig is present.
There should not be a difference between what VS does and what dotnet-format
does assuming you are using the default VS settings. This sounds like a bug. @AdamCaviness can you provide a repo project?
from format.
I forked this repo to demonstrate it here. The format.sln has two projects, dotnet-format.csproj and dotnet-format.UnitTests. In this case I want to format the sln solution file and still prevent dotnet-format from formatting files in the UnitTests project.
I replaced the true editorconfig in the solution root with a modified one. I then added a new editorconfig to the UnitTests project directory. This works well for VS2019 as it does not recommend any changes and "format document" doesn't do anything for files in the UnitTests project.
When running dotnet-format against the sln solution file however, files are mutated in the UnitTests project.
Clone the repo and run dotnet-format against the format.sln.
from format.
I forked this repo to demonstrate it here.
Nested .editorconfigs still not supported
Why this closed?
from format.
Nested .editorconfigs still not supported
@s-tarasov Can you open a new issue with what you are seeing in more detail? I verified that the behavior described in this issue has been fixed.
from format.
Related Issues (20)
- --binarylog option broken HOT 3
- Please clarify if this tool is actively supported / worked on HOT 2
- Can I use dotnet format to just generate report and not make the changes to the file. HOT 2
- Issue: Limited Scope for Running the Tool on Changed Files in Pull Requests HOT 1
- running dotnet format on my unity project takes over an hour HOT 2
- .net 8.0.2 Blazor `_imports.razor` & using `IDE0005` HOT 4
- Not detect IDE0290. HOT 1
- IDE0051 format issues with Razor code behind files with SDK 8.0.200 HOT 4
- Questions around Contributing to the Repo HOT 5
- dotnet format is now part of the SDK repo HOT 1
- Wrong indentation when using primary constructor
- Simplify interpolation (IDE0071) - false positive with Enum and FormattableString
- CA1067 on C# record implementing a VB.NET interface
- Does not adhere to language set in `DOTNET_CLI_UI_LANGUAGE`
- Line wrapping and indentation of Collection Literals
- Error Changing document properties is not supported
- CS0534 validation adding wrong code. HOT 1
- pre-commit hook fails: no compatible SDK was found HOT 1
- Feature Request: Support for Excluding Specific Subcommands with --skip in dotnet format
- Can't suppress WHITESPACE warnings HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from format.