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

Unhandled exception in check-git-config-email #58

Closed
sadikkuzu opened this issue Mar 27, 2022 · 1 comment
Closed

Unhandled exception in check-git-config-email #58

sadikkuzu opened this issue Mar 27, 2022 · 1 comment

Comments

@sadikkuzu
Copy link
Contributor

sadikkuzu commented Mar 27, 2022

When git config --get user.email returns non-zero exit status, check-git-config-email should handle this situation.

To reproduce:

docker run -it --rm python:latest bash -xc '\
cd ; \
pip install pre-commit ; \
git clone https://github.com/homebysix/pre-commit-macadmin.git ; \
cd pre-commit-macadmin ; \
git checkout --track origin/dev; \
pre-commit autoupdate; \
pre-commit run -a; \
echo "  - repo: https://github.com/homebysix/pre-commit-macadmin" >> .pre-commit-config.yaml; \
echo "    rev: v1.12.2" >> .pre-commit-config.yaml; \
echo "    hooks:" >> .pre-commit-config.yaml; \
echo "    -   id: check-git-config-email" >> .pre-commit-config.yaml; \
echo "        args:" >> .pre-commit-config.yaml; \
echo "          - \"--domains\"" >> .pre-commit-config.yaml; \
echo "          - \"acme.com\"" >> .pre-commit-config.yaml; \
echo "          - \"paramount.com\"" >> .pre-commit-config.yaml; \
echo "        always_run: true" >> .pre-commit-config.yaml; \
echo "        exclude: ^$" >> .pre-commit-config.yaml; \
pre-commit run -a; \
git config --global user.email; \
echo $?;'

image

@homebysix
Copy link
Owner

This should be fixed in 1.12.3. Thanks!

[INFO] Initializing environment for https://github.com/homebysix/pre-commit-macadmin.
[INFO] Installing environment for https://github.com/homebysix/pre-commit-macadmin.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
check python ast.........................................................Passed
check BOM - deprecated: use fix-byte-order-marker........................Passed
check for case conflicts.................................................Passed
check docstring is first.................................................Passed
check that executables have shebangs.....................................Passed
check for merge conflicts................................................Passed
check yaml...............................................................Passed
fix end of files.........................................................Passed
fix python encoding pragma...............................................Passed
mixed line ending........................................................Passed
don't commit to branch...................................................Passed
trim trailing whitespace.................................................Passed
black....................................................................Passed
Check Git Config Email...................................................Failed
- hook id: check-git-config-email
- exit code: 1

Git config email is not set.

+ git config --global user.email
+ echo 1
1

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

2 participants