Giter VIP home page Giter VIP logo

Comments (5)

zihotki avatar zihotki commented on August 11, 2024

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.

jmarolf avatar jmarolf commented on August 11, 2024

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.

AdamCaviness avatar AdamCaviness commented on August 11, 2024

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.
format-execution
VS2019_Team_Exp-changes-after-format-execution

from format.

s-tarasov avatar s-tarasov commented on August 11, 2024

I forked this repo to demonstrate it here.

Nested .editorconfigs still not supported

Why this closed?

from format.

JoeRobich avatar JoeRobich commented on August 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.