kvz / ochtra

One Commit Hook To Rule All
MIT License
86 stars 13 forks source link

Blatantly ignores relevant dotfiles #9

Open pluma opened 10 years ago

pluma commented 10 years ago

This pre-commit hook is a great idea, but sadly I can't reasonably use it in JS projects because it completely bypasses the relevant .jshintrc files by reading from STDIN instead of from disk.

Is there any way to fix this problem or is it a limitation of git hooks in general?

kvz commented 10 years ago

How did you install ochtra? If it's a symlink, the current directory will not be your project's, and jshint will not be able to travel upwards until it finds your project's .jshintrc

pluma commented 10 years ago

It's not a symlink. I added the file to my git template and it's a regular file in .git/hooks/. Even .jshintrc in the gitroot is ignored, though.

kvz commented 10 years ago

Hm. and what if you point jshint to your rc file via --config? Just to start ruling things out?

abtris commented 4 years ago

It's general problem. I try resolve for eslint but didn't find why how get local config in hooks.

Whole check doesn't have access to to project folder and we check only files in commit, don't read everything.

Many users can used different settings for project and we can't cover all possibilities. I seen many project .jshintrc or .eslintrc or .eslintrc.js. How we can decide? You can change CMD that is used for check in your template.

@kvz can we help project root directory as variable in ochtra?