jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 510 forks source link

checkString ignores excludeFiles #2031

Closed Arcanemagus closed 8 years ago

Arcanemagus commented 8 years ago

It seems that the checkString function doesn't handle the excludeFiles section of the configuration as reported by several people using the Atom package linter-jscs here: https://github.com/AtomLinter/linter-jscs/issues/83

Their configuration is being loaded and processed properly, but when checkString is called with the file contents and the path of a file that should be ignored errors are being reported back.

Is this an issue here in jscs, or are we somehow utilizing it improperly here?

markelog commented 8 years ago

Well yeah, it is called "checkString" for a reason :-), it doesn't deal with paths, second argument is need just to tell the reporter where is the violation. In other words use "checkPath"

Arcanemagus commented 8 years ago

Thanks for the information, I guess we will have to work around this limitation in the package.

Note: Other linters handle their file ignore patterns if passed a string as long as they are also passed an original file path, so I assumed this was similar and just not working.

markelog commented 8 years ago

Hm, will you able to send us a pr? I suppose we can do that, if that is really needed. Would want you to create some hacks in your app, instead of just using it

Arcanemagus commented 8 years ago

I can try putting something together, it's going to be a while before I can get to it though. If somebody who is actually familiar with the code wants to take a stab at it that would be appreciated.