-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add the ability to disable individual rules per-buffer #155
Conversation
This change introduces a buffer-local version of 'g:EditorConfig_disable_rules'. It's useful in cases where EditorConfig rules are in conflict with the file syntax, e.g. space indents in Makefiles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the problem you mention: incorrect .editorconfig settings for Makefiles can cause issues. However, I think that fixing the .editorconfig
files for those projects would be a more consistent solution than disabling specific rules. The overall goal of EditorConfig is consistency, and permitting users to pick and choose rules is more likely to break consistency than to promote it.
Example: suppose I am working on a project with a broken .editorconfig
, and I add a disable-rules to my vimrc
. Then that project will not experience breakage. Suppose I then switch to a different project, but forget to remove the disable-rules from vimrc
. I will think the EditorConfig settings are all being applied, when in fact they are not.
(Of course, you can always run your own fork of the plugin with whatever features you want, even if this PR doesn't get merged :) .)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @cxw42 . The EditorConfig website says:
EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.
If the settings of Makefile is incorrect, it's better to correct the .editorconfig
files to make it consistently correct across all editors, than to add hot fixes to each editor plugin.
Are there other specific applications you have in your mind?
I haven't run into this problem outside of Makefiles, but I did run into it often because I occasionally write my own personal Makefiles for projects that doesn't have one. I just currently disable EditorConfig altogether for Makefiles, but I thought it'd be great if I can only disable rules that's causing a problem. However, I do think this is a minority use case, so I'm happy with closing this PR though. |
@midchildan Thanks very much for your understanding! For what it's worth, I have never had a PR rejected for adding a .editorconfig file ;) . Happy hacking! |
This change introduces a buffer-local version of
g:EditorConfig_disable_rules
. It's useful in cases where EditorConfigrules are in conflict with the file syntax, e.g. space indents in Makefiles.
Somewhat related to #154