evanshortiss / lintspaces-cli

A CLI for the node-lintspaces module.
MIT License
18 stars 6 forks source link

--regexIgnores does not work as documented #15

Closed imgx64 closed 7 years ago

imgx64 commented 8 years ago

--regexIgnores simply doesn't work. In https://github.com/evanshortiss/lintspaces-cli/blob/4586b20d670148a575aef3dfcd9d459b1059ab33/index.js#L92 , only program.ignores is passed to lintspaces. program.regexIgnores is not used anywhere after it's initialized.

--regexIgnores is also wrongly documented. README.md says that it takes an argument like this: -r '/pointless|regex/g' -r '/and|another/gi ', but the code uses new RegExp(r) constructor, which only takes a pattern without the begin and end slashes and without flags. This means it's impossible to pass the g flag, therefore only ignoring the first occurrence of the regexp.

evanshortiss commented 8 years ago

Nice find regarding the regexIgnores. Happy to accept a PR if you have one @imgx64.

Some backstory. This feature is not something I need and did not have a great deal of time to work on. I asked others who requested it to contribute and test, but received no feedback so I moved along.

It needs some work for sure based on your findings, and it's a tricky one to solve.

evanshortiss commented 8 years ago

Adding hacktoberfest label in case anyone is interested. I think the final solution might just use eval, not a great solution but workable.

evanshortiss commented 7 years ago

Closing this for now. Definitely a desirable feature.