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

Commit fails due to existing pre-commit hook #720

Open
arnauldvm opened this issue May 23, 2023 · 1 comment
Open

Commit fails due to existing pre-commit hook #720

arnauldvm opened this issue May 23, 2023 · 1 comment

Comments

@arnauldvm
Copy link

arnauldvm commented May 23, 2023

Description of your problem

Trying to create a project in a context where there are git pre-commit hooks may fail in case code generated by pyscaffold is not accepted by the hook.

Please provide a minimal, self-contained, and reproducible example.

$ putup myproject
ERROR: 8       E501 line too long (80 > 79 characters)
1       W292 no newline at end of file
>>>> PEP8 failures for 'docs/conf.py' [stat=1]

Please provide any additional information below.

Workaround I currently use:

$ git config --global core.hooksPath /dev/tools
$ putup myproject
(...)
done! 🐍 🌟 ✨
$ git config --global --unset core.hooksPath

But this is quite uggly.

Suggestion: add a parameter (or env var) to explicitly disable pre-commit (cf. git commit --no-verify), or (more generic) to inject arbitrary git parameters.

Versions and main components

  • PyScaffold Version: 4.4.1
  • Python Version: 3.9.0
  • Operating system: Linux
  • How did you install PyScaffold: (conda/pip): pip
@abravalheri
Copy link
Collaborator

Hi @arnauldvm, thank you very much for reporting this issue.

I did not manage to run your reproducer in a way it shows the errors you reported... What I find weird is that the generated .pre-commit-config.yaml file explicitly excludes docs/conf.py.

Could you please provide the output of the putup command in the verbose mode? (e.g putup myproject --pre-commit -vv)

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