-
Notifications
You must be signed in to change notification settings - Fork 106
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
Can't override editorconfig locally #324
Comments
See #148. |
Note: that issue is only about dir-locals, but editorconfig seems to always override even my file local variables. |
Hi! I updated the code and added two new variables I'm not going to set these variables to nil by default, because it is not likely that other editors support dir-locals.el files... |
Thank you! I still feel though that for Emacs, you expect that dir-locals and file-locals should be able to override any other configuration by default. The typical scenario is that a project has a .editorconfig file in its root (and perhaps additional ones per subdir), and then under one of the subdirs you may have some third party code or legacy code that follows its own rules, perhaps checked out as a dependency or git-subrepo, and that code may come with file-local annotations or a .dir-locals file. In that setting I expect Emacs to follow the most local rules for editing those files, not the project-wide rules. Maybe not everyone agrees. |
We can add another .editorconfig file in the directory for that case. Yeah, I know we can avoid creating new file explicitly if local variables override editorconfig values by default. |
If it's third party code, I'd have the choice of either asking them to add an .editorconfig file to their repo, which they may rightly think is irrelevant to them, or manually add a local .editorconfig file myself, which would then make git report a new untracked file (unless I also tell git to ignore it locally), and I'd have to remember to stop and do this just when I realize I want to edit a file in that subrepo. Philosophically, I don't think it's right for Emacs to ignore these. Maybe editorconfig could automatically offer to copy settings from .editorconfig to .dir-locals and/or vice versa, if both exist in the same dir and one of them is newer? |
I'm on Emacs 29, and no matter what I do, it seems that editorconfig always overrides both dir-locals files and file local variables.
The text was updated successfully, but these errors were encountered: