zmbush / coffeelint-ruby

This adds some simple bindings to ruby to enable use of coffeelint
MIT License
32 stars 23 forks source link

Add support for .coffeelintignore standard #36

Closed mlarraz closed 9 years ago

mlarraz commented 9 years ago

Needs actual testing

zmbush commented 9 years ago

If you added some tests, I would be happy to merge this.

mlarraz commented 9 years ago

Finally got around to updating this with some tests

zmbush commented 9 years ago

Thanks, this looks good.

ngottlieb commented 5 years ago

This behaves a little weirdly, I think. I'm happy to submit a PR to change it but wanted to run the issue by you before I go ahead.

So -- the current code that reads .coffeelintignore reads each line, then just appends those paths to Dir.glob("#{directory}/**/#{ignored_paths}. The trouble is that .coffeelintignore is in the root of your repo, and so it would make sense to me if you were putting full paths into .coffeelintignore instead of relative paths from whatever folder you're trying to lint.

Here's a practical example. I'm working in Rails using the rake coffeelint task which calls Coffeelint.run_test_suite('app'). I have a vendored bootstrap theme in my javascript folder at app/assets/javascript/my_theme/ with a bunch of Coffeescript files in it that I don't want linted. I would expect my .coffeelintignore to look like this:

app/assets/javascript/my_theme/*
app/assets/javascript/other_thing_to_ignore.coffee

like a .gitignore, but that doesn't work with the current code. Instead, I have to do this:

my_theme/*
other_thing_to_ignore.coffee

it works fine, but it's not the behavior I would've expected. It's an easy fix or change -- just wanted to check if you agreed about changing it before I went ahead with a PR.