notslang / editorconfig-tools

Tools for verifying/fixing code style based on an EditorConfig file
https://npmjs.com/package/editorconfig-tools
GNU General Public License v3.0
54 stars 6 forks source link

Often skips single vs double quote check #14

Open mcandre opened 9 years ago

mcandre commented 9 years ago

I want to enforce single quotes for strings across all my JavaScript (*.js) files, but for some reason this linter is ignoring lib/regenboog.js.

Code:

https://github.com/mcandre/regenboog/tree/ac12033014bc08e08988ecedb461263b8005f4a4

Configuration:

[*.js]
quote_type = single

Trace:

$ grunt editorconfig
Running "exec:editorconfig" (exec) task
./Gruntfile.js failed max_line_length on line 16: line is 1337 chars, it should be 800
./passwords.txt failed trim_trailing_whitespace on line 2627: found setting 'false', should be 'true'
./README.md failed indent_char: found setting '  ', should be '    '
notslang commented 9 years ago

Actually, it should always skip single vs double quote checks... we don't have a rule defined for that yet.

I would be happy to add one, but I'm pretty sure this requires language-specific parsing, right?

mcandre commented 9 years ago

That would be a great addition!

Ideally, this feature would be supported for JavaScript, Ruby, Python, and Bash, since those languages tend to have the most single vs double quote fights.

jednano commented 9 years ago

You can't do that w/o parsing the file into a language-specific syntax tree. CodePainter does this for JavaScript.

jednano commented 9 years ago

@slang800 this issue should be closed as a wontfix. There's no way to do it w/o knowledge of the language being formatted.