For questions regarding the pre-commit framework, not to be confused with git pre-commit hooks generally. Use this tag only when your question involves the framework. The tool pre-commit is a framework for managing and maintaining multi-language pre-commit hooks.
Questions tagged [pre-commit.com]
309 questions
-1
votes
1 answer
Pre-commit-hooks without tag?
I have a GitLab repo, but no tags.
What is the initial tag of a repo? v1.0.0?
repos:
- repo: https://gitlab..com/xxx/yyy/zzz.git
rev: 1.0.0
hooks:
- id: black
- id: trailing-whitespace
- id: flake8
- id:…

ku11
- 43
- 5
-1
votes
2 answers
How to warn if code contains %s formatting
I use Python since 2001, and I am very used to %s string formatting.
In my current environment code should be formatted with f-strings.
How to automatically check my code, so I don't accidentally use my old habit?

guettli
- 25,042
- 81
- 346
- 663
-2
votes
0 answers
Pre-commit error while finding branch name
I am new to pre-commit and I am trying to implement Black with pre-commit.
The link to the documentation that I am following is given…

programmer_04_03
- 137
- 8
-2
votes
1 answer
Automatically re-running hook on whole repository after upgrading it
Let's say we have some hook for a tool like Black (formatter for Python). Let's say we upgrade the hook to a version of the tool that introduces significant changes to its behavior.
Ideally we would want to re-run the hook on all the files in the…

Ilia Kurenkov
- 637
- 5
- 12
-2
votes
1 answer
run pre-commit quit format a documents
I have a problem when executing the pre-commit in a python project, although my files have the correct format, it shows an error and removes the correct format. Could you help me find out what is causing…

Lana
- 117
- 5
-2
votes
1 answer
Pre Commit Run Failing
Whenever I am trying to run pre-commit run is failing.I am getting errors in flake8,black,end of file,Validate filenames ,and trailling white spaces .My python code is
from __future__ import annotations
def hopkinsons_law(
…

R3hankhan
- 58
- 1
- 10
-2
votes
2 answers
Trying to implement trufflehog in my pre-commit however, receiving an entry point error- does any have an example pre-commit config file?
I am trying to use Truffle hog credentials scanner every time I run a commit. Below is both my .precommit config file and error in the terminal.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id:…

JnooriRS
- 103
- 11