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

Add the ability to disable individual rules per-buffer #155

Closed

Conversation

midchildan
Copy link
Contributor

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.

Somewhat related to #154

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
@cxw42 cxw42 self-requested a review October 20, 2020 16:50
Copy link
Member

@cxw42 cxw42 left a 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 :) .)

@cxw42 cxw42 requested a review from xuhdev October 20, 2020 16:54
Copy link
Member

@xuhdev xuhdev left a 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?

@cxw42
Copy link
Member

cxw42 commented Oct 21, 2020

I had forgotten until just now that we have g:EditorConfig_disable_rules (#89, #90). If it were up to me, I would remove that variable as well, so please don't think of it as a model :) .

@midchildan
Copy link
Contributor Author

midchildan commented Oct 21, 2020

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.

@cxw42
Copy link
Member

cxw42 commented Oct 21, 2020

@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!

@cxw42 cxw42 closed this Oct 21, 2020
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

Successfully merging this pull request may close these issues.

3 participants