Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blatantly ignores relevant dotfiles #9

Open
pluma opened this issue May 23, 2014 · 4 comments
Open

Blatantly ignores relevant dotfiles #9

pluma opened this issue May 23, 2014 · 4 comments

Comments

@pluma
Copy link

pluma commented May 23, 2014

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
Copy link
Owner

kvz commented May 26, 2014

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
Copy link
Author

pluma commented May 27, 2014

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
Copy link
Owner

kvz commented May 27, 2014

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

@abtris
Copy link
Collaborator

abtris commented Aug 1, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants