sindresorhus / atom-editorconfig

Helps developers maintain consistent coding styles between different editors
https://atom.io/packages/editorconfig
MIT License
812 stars 80 forks source link

Introduce a more strict grammar #113

Closed yudai-nkt closed 7 years ago

yudai-nkt commented 7 years ago

To make the maintainer's life easier, I...

The current grammar is quite rough and it matches to anything in the form of key = value. This PR disallows matching to such malformed settings and only highlights valid ones listed in EditorConfig's Wiki. This will visually help users notice invalid lines (e.g., they made a typo or didn't remember the correct key/value name).

P.S. The default indent_style is set to tab in .editorconfig of this repo, but grammars/ini.cson uses 2-space indentation. I respected the consistency in a file.

florianb commented 7 years ago

Hey @yudai-nkt, thank you -- this is pretty good, i would love to add this to the next release.

Even though the new matchers are pretty more explicit they currently do not match uppercase values. I would appreciate if you could add case insensitiveness but i guess we need to use char-classes ([oO][fF][fF]) implement that.

I can do it, too but it will take its time.

P.s.: The .editorconfig of this repo is not complete. I need to add that rule.

yudai-nkt commented 7 years ago

I would appreciate if you could add case insensitiveness

Sure, I've added that feature. I didn't notice that EditorConfig is case insensitive although it's documented in Wiki.

florianb commented 7 years ago

Awesome! I wasn't aware of that, too.. 😄