[PATCH] D135789: Add .editorconfig file

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 12:45:56 PDT 2022


aaron.ballman added inline comments.


================
Comment at: .editorconfig:8
+charset = utf-8
+trim_trailing_whitespace = true
----------------
beanz wrote:
> aaron.ballman wrote:
> > Do these settings apply to the whole file when it is saved, or only to the modifications in the file as they're being made?
> > 
> > I ask because of `trim_trailing_whitespace` specifically -- I have a text editor that does that automatically already when saving a file and I have to configure it to *not* do that because of how often it ends up making unrelated changes in a file when saving; especially our older test cases in Clang.
> > Do these settings apply to the whole file when it is saved, or only to the modifications in the file as they're being made?
> > 
> > I ask because of `trim_trailing_whitespace` specifically -- I have a text editor that does that automatically already when saving a file and I have to configure it to *not* do that because of how often it ends up making unrelated changes in a file when saving; especially our older test cases in Clang.
> 
> That's a really good point. The documentation on https://editorconfig.org doesn't specify, so it might be editor dependent, but probably impacts the whole file.
> That's a really good point. The documentation on https://editorconfig.org doesn't specify, so it might be editor dependent, but probably impacts the whole file.

If these impact the whole file, that's... troublesome for the trailing whitespace and the indentation fields because both of those will likely lead to unrelated edits in files. Perhaps we should see what supported editors do currently? If they all mostly agree and don't modify the whole file, maybe we can get away with it?

> We could. I think at some point I'd like to get LLVM & Clang building and passing tests with autocrlf enabled at which point that would become a potential problem.

Can we opt specific files out of autocrlf (Clang has a handful of test cases that are line ending sensitive)?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135789/new/

https://reviews.llvm.org/D135789



More information about the llvm-commits mailing list