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

pre-commit hook not working on macos #166

Open
LucasBourgeois opened this issue Oct 24, 2023 · 0 comments
Open

pre-commit hook not working on macos #166

LucasBourgeois opened this issue Oct 24, 2023 · 0 comments

Comments

@LucasBourgeois
Copy link

Hi,

Im facing an issue using this package.
Here is actual command im using :
git diff --cached --name-only --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx)$' | xargs -r -P $(nproc) -I {} -n 1 eslint -c .eslintrc.json --max-warnings 0 '{}'
It's getting updated file names and is running eslint for every of those files.

Even if eslint is giving error and error code exit 1; pre-commit isnt stopping commit to being added.
nproc is a linux process, i created a polyfill of this in usr/local/bin of nproc to do the same but for mac.
actually, i could use an integer instead of $(nproc)

The problem is that it's working perfectly on linux.
But on macos, exit code is 0 and not 1.
Even if i replace this long command by a simple "exit 1;" pre-commit still allow commit to be done.

It appears that there is an issue on macos but i really don't know what.

any idea ?

Im on macos ventura.
pre-commit version : ^1.2.2
Node version : 19
Git version : 2.39

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

1 participant