ochtra icon indicating copy to clipboard operation
ochtra copied to clipboard

Blatantly ignores relevant dotfiles

Open pluma opened this issue 11 years ago • 4 comments

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?

pluma avatar May 23 '14 15:05 pluma

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

kvz avatar May 26 '14 10:05 kvz

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.

pluma avatar May 27 '14 12:05 pluma

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

kvz avatar May 27 '14 12:05 kvz

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?

abtris avatar Aug 01 '19 11:08 abtris