jednano / eclint

Validate or fix code that doesn't adhere to EditorConfig settings or infer settings from existing code.
MIT License
307 stars 28 forks source link

.gitignore paths starting with slash are not treated properly #113

Closed bashmish closed 6 years ago

bashmish commented 6 years ago

In my .gitignore I have

/bower_components-1.x/

I want to exclude a folder on the root level, I'm sure this is a folder, and want to exclude it on the root level only, that's why I need slash both in the beginning and in the end.

eclint still checks this folder and complains about it.

If in .gitignore I do bower_components-1.x/, eclint skips it, but then in my project I have other dirs with this name excluded, for example test/assets/bower_components-1.x/, that I want to prevent.

Looks like a bug when processing exclusions starting with slash.

gucong3000 commented 6 years ago

@bashmish Sorry for the late reply.

Maybe this will avoid the problem:

eclint check $(git ls-files)