Skip to content
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

Open
richcarl opened this issue Feb 19, 2024 · 5 comments
Open

Can't override editorconfig locally #324

richcarl opened this issue Feb 19, 2024 · 5 comments
Assignees

Comments

@richcarl
Copy link

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.

@jcs090218
Copy link
Contributor

See #148.

@richcarl
Copy link
Author

richcarl commented Mar 8, 2024

See #148.

Note: that issue is only about dir-locals, but editorconfig seems to always override even my file local variables.

@10sr 10sr self-assigned this May 14, 2024
@10sr
Copy link
Member

10sr commented May 31, 2024

Hi!

I updated the code and added two new variables editorconfig-override-file-local-variables and editorconfig-override-dir-local-variables, which are set to t by default. When editorconfig-override-dir-local-variables is set to nil, this plugin will not override values when it is defined in dir-locals.el .

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...

@richcarl
Copy link
Author

richcarl commented Jun 3, 2024

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.

@10sr
Copy link
Member

10sr commented Jun 7, 2024

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.
But, what I worry about is the case where users forget to add entries to .editorconfig file because they are already configured in .dir-locals.el .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants