schorfES / node-lintspaces

A validator for checking different kinds of whitespaces in your files.
https://npmjs.com/package/lintspaces
MIT License
30 stars 17 forks source link

respect file extensions definitions in .editorconfig #24

Closed mlarcher closed 8 years ago

mlarcher commented 9 years ago

It seems that the plugin will not account for [*.extension] specific declarations in .editorconfig file when using the editorconfig option (was https://github.com/ck86/gulp-lintspaces/issues/10 )

schorfES commented 9 years ago

I've added a test for this case and this works as expected... b7dbfab2db13276fab4771a1c3a2afff55f5d4c6

wrong settings? gulp-lintspaces issue? any ideas?

mlarcher commented 9 years ago

I still can reproduce the issue with the following setting:

[*.html]
indent_size = 5

No error is raised.

Is it possible that this one is ignored ?

schorfES commented 8 years ago

Still an issue?

mlarcher commented 8 years ago

I just tested with the latest gulp-lintspaces, which requires lintspaces 0.3.3 (so the latest), and I get mixed results : with

[*.html]
indent_size = 2

in my .editorconfig and 2 spaces in my html files, I don't get any error. When I add a third space to the beginning of a line that is supposed to have 2 spaces, lintspaces righfully exits with an error, but it says that the indentation should be 4 spaces, not 2. And when I add another space to make it 4, it doesn't complain anymore than with 2 spaces.

So it seems there is still an issue there...

schorfES commented 8 years ago

Lintspaces doesn't parse your code. So a setting for indentation by 2 spaces all multiples of 2 are valid indentations... so 0, 2, 4, 6 etc. will be valid. So this isn't an issue. When using spaces which are not multiples of the previous setting, the lintspaces try to assume the valid indentation for the report (see line line 458).

I think you get the same results when setting the indentation through the settings directly compared to loading settings from the .editorconfig