Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
201 views

Given a .pre-commit-config.yaml: repos: - repo: local hooks: - id: mypy name: mypy language: system entry: uv run mypy types: [python] require_serial: true exclude: scripts/...
Seanny123's user avatar
  • 9,456
0 votes
1 answer
144 views

I have to run command, which 1 argument requires output from another command (see below). Is there a way how to accomplish this? Either in entry or args? Or does pre-commit offer some built in feature ...
Arxeiss's user avatar
  • 1,078
2 votes
1 answer
133 views

I am working on new project and installed pre-commit using: python -m pip install pre-commit within my created environment (i.e. a python=3.9 env) When I run pre-commit, I had an incompatibility ...
Betty's user avatar
  • 268
-2 votes
2 answers
1k views

I am trying to enable mermaid in mkdocs using the material theme. According to the docs I should be able to enable it via: markdown_extensions: - pymdownx.extra: pymdownx.superfences: ...
Soerendip's user avatar
  • 9,335
1 vote
1 answer
87 views

I’m currently working on a few repositories that contain Nix flakes. You can test a Nix flake by running this Bash command: nix flake check That command will only work if you have the nix-command and ...
Ginger Jesus's user avatar
-3 votes
1 answer
130 views

.pre-commit-hooks.yaml is like below: - id: google-style-java name: Google Java Code Style for Java description: Formats code in Google's Java codestyle. entry: ./format-code.sh ...
tuk's user avatar
  • 6,964
0 votes
1 answer
908 views

I'm using uv as my package manager in my Python project. My pyproject.toml file looks like this: [project] name = "some-name" version = "0.1.0" readme = "README.md" ...
Ghasem's user avatar
  • 15.8k
0 votes
2 answers
97 views

Is there a way to tell the pre-commit (pre-commit.com) to apply fixes just to the modified text instead of the entire files touched? We want to set up spellchecking (using typos) on our API models, ...
Peter Silon's user avatar
0 votes
1 answer
106 views

I have a pre-commit configuration that I use inside a Go repository. This repository includes Go files and Swagger docs generated by Protobuf so I want to exclude those from the checks to avoid issues ...
Woody1193's user avatar
  • 8,212
0 votes
1 answer
240 views

I'm using some pre-commit hooks for Buf to help me check Protobuf files before compiling them to Go: repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 # Use the ref you ...
Woody1193's user avatar
  • 8,212
0 votes
0 answers
61 views

I'm building a python app with a .toml file. I'm using poetry to deal with dependencies and packaging. Here is an extract of my toml file [tool.poetry] name = "app_name" version = "0.1....
Aydin Abiar's user avatar
-1 votes
1 answer
111 views

I'm setting up cfn-lint as a pre-commit hook using this guide: https://aws.amazon.com/blogs/mt/git-pre-commit-validation-of-aws-cloudformation-templates-with-cfn-lint/ My .pre-commit-config.yaml: ...
Steyn van Wyk's user avatar
0 votes
1 answer
1k views

I'm trying to run the pre-commit tool in a GitLab pipeline. I use a custom-built Python image that has git installed in the pipeline job. I install pre-commit at the start of the job using a pip ...
mdailey77's user avatar
  • 2,681
-1 votes
1 answer
399 views

I am using pre-commit. In one of the hooks, I use a python script that imports the yaml library. However, when I try to commit something, I get the following error on this hook : ModuleNotFoundError: ...
Nakeuh's user avatar
  • 1,933
1 vote
1 answer
229 views

I am using pre-commit to manage local hooks for my repository. Initially, I added a local repository containing my hooks and configured the .pre-commit-config.yaml file to reference these hooks. It ...
Jaydubz's user avatar
  • 19
1 vote
2 answers
2k views

I'm starting to use pre-commit, and I have a single repository with a pre-commit-config.yaml file that I want all the other (many more) repositories to simply 'include'. Is there a way to do that? The ...
Relys's user avatar
  • 85
0 votes
0 answers
241 views

From the precommit package (https://cran.r-project.org/web/packages/precommit/index.html), I'm taking the default pre-commit-config.yml file as my starting point. You can recreate it with precommit::...
Justin Beresford's user avatar
4 votes
1 answer
2k views

I've been using pre-commit for quite a while successfully! recently I updated and I'm getting a new error message but it worked fine before here is the error message: $ pre-commit run --all-files [...
anthony sottile's user avatar
0 votes
1 answer
1k views

Need to understand that what is causing the issue in the pre-commit hook section of sqlfluff Although sqlfluff-templater-dbt is installed sqlfluff is installed, but gets and error that templater 'dbt'...
Ashutosh Sharma's user avatar
0 votes
2 answers
905 views

mypy runs perfectly on terminal, but when running on pre-commit stage, I am getting the error Unexpected keyword argument for every property in my class from attrs import define, field @define( ...
Sebastian Souza Tarnowski's user avatar
0 votes
1 answer
635 views

I'm using pdm, and each project has its own .venv. When using mypy, I need to specify venv like mypy --python-executable ./.venv/Scripts/python.exe . on windows or mypy --python-executable ./.venv/bin/...
Chuang Men's user avatar
1 vote
1 answer
547 views

I'm using clang-tidy in my C++ project, and I'm encountering errors related to third-party dependencies, specifically Abseil (absl). I want to skip checking these dependencies. jiawei@DESKTOP-AEQS7B5:~...
Jiawei Lu's user avatar
  • 587
0 votes
0 answers
60 views

I'm using pre-commit along with the source-control in vscode. I want to be able to specify the cache directory of pre-commit, so I defines the PRE_COMMIT_HOME environment variable in .bashrc. ...
GuillaumeA's user avatar
  • 3,575
1 vote
1 answer
642 views

I'm having great difficulty making something that seems simple and logical but doesn't work. As part of a GitHub repository with Python code, I want to manage a pre-commit that will launch a python ...
Geoffrey's user avatar
1 vote
1 answer
1k views

I have a task to move CI/CD from Gitlab to GitHub Actions and there is one last obstacle I encounter. PreCommit library is not working. Everything worked fine in gitlab and that is why I have no idea ...
KurczakChrupiacy2's user avatar
2 votes
1 answer
1k views

I'm using Prettier with pre-commit to format my code before committing. However, I encountered an issue where Prettier doesn't seem to recognize the plugins. With this setup, Prettier is not able to ...
Lajos's user avatar
  • 2,857
8 votes
3 answers
1k views

When i commit changes via Github Desktop, pre-commit cannot handle the changes and commit them but overwrites all other stages changes (the once i didn't intent to commit now) by its improvements. ...
Ramon Droop's user avatar
0 votes
1 answer
510 views

I'm using a commitizen and a pre-commit - repo: https://github.com/commitizen-tools/commitizen rev: v3.27.0 hooks: - id: commitizen name: commit message check On local everything is ...
kostek's user avatar
  • 3
2 votes
1 answer
1k views

I've set up a pre-commit hook using Ruff to handle linting in my project. I've configured the hook as per the documentation: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.4.9 hooks: ...
Gonçalo Guedes's user avatar
0 votes
0 answers
148 views

I would like to install pre-commit on msys2, I ran pacman -S mingw-w64-x86_64-python-pre-commit successfuly but when I try to run it after pre-commit in a repo with hooks, I got the following error: $ ...
RobinM's user avatar
  • 59
1 vote
0 answers
2k views

I am trying to run pre-commit using hooks from a private repository using a GIT_TOKEN. Before running pre-commit run --all-files, I insert my GIT_TOKEN (which has read access to the hooks repository) ...
Jakob Drachmann Havtorn's user avatar
1 vote
2 answers
1k views

I am trying to build a custom pre-commit hook written in Go. It should run on python file. The project has the following architecture: comche/ ├── cmd/ │ └── main.go ├── scripts/ │ └── main -> ...
Adrien Riaux's user avatar
0 votes
1 answer
90 views

While trying to make slither work with pre-commit, I noticed slither expects a single file, or directory as CLI args, whereas (my) pre-commit-config.yaml provides slither with a list of space ...
a.t.'s user avatar
  • 2,931
1 vote
1 answer
117 views

Context I have tried 3 different approaches to running SolHint 4.5.4 using pre-commit. Run with separate run_solhint.sh script, which works but I cannot get the bash syntax to work with .pre-commit ...
a.t.'s user avatar
  • 2,931
0 votes
1 answer
693 views

i cleaned cache with pre-commit clean && pre-commit gc but it still shows me errors i already fixed: $ git commit -m "fake commit" [WARNING] Unstaged files detected. [INFO] Stashing ...
swats-the-floran's user avatar
0 votes
1 answer
718 views

Need some help desperately now: I am creating a pre-commit hook to trigger dotnet format tool when git commit -m "" And I have a p.re-commit-config.yaml file right inside the solution root ...
Sophie cai's user avatar
15 votes
1 answer
10k views

The ~/.cache/pre-commit/ folder is many GB large, how do I clean it? Can I simply delete it? Or at least delete all the files? Or do I have to be selective about it? Is there a command for cleaning ...
user66554's user avatar
  • 1,118
0 votes
1 answer
822 views

I have a pre-commit hook running a local executable and I set the pass_filenames to true. When there are 11 files to modify in the git staging area, the hook is called three times with different ...
Zranz's user avatar
  • 67
1 vote
2 answers
3k views

I'm setting up pre-commit hooks on my project and I'm working with self-developped packages that happen to be in root of the project and I can't seem to add them as additional_dependencies in my ...
thmo's user avatar
  • 199
1 vote
1 answer
2k views

I'm putting together some pre-commit hooks for a project that I'm working on, and one of the hooks we want to use is MyPy. The pre-commit results are throwing up a lot of non-error notes related to ...
TheEponymousProgrammer's user avatar
1 vote
3 answers
4k views

I try to use pre-commit on VSCode. I installed ruff, black, mypy and flake8 using poetry. Pre-commit-config.yaml default_language_version: python: python3.10 repos: - repo: local hooks: ...
serg's user avatar
  • 87
0 votes
1 answer
1k views

I'm referencing just commands in custom pre-commit hooks. For some reason, just is interpreting staged files as recipes, which leads to trim trailing whitespace............................................
amiola's user avatar
  • 3,167
-1 votes
1 answer
335 views

This is my .pre-commit-config.yaml repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: - id: fix-encoding-pragma - id: check-ast In same directotry ...
WebOrCode's user avatar
  • 7,392
0 votes
1 answer
1k views

Locally run ansible-lint pre-commit behaves differently than run during CI/CD. I use following --- repos: - repo: https://github.com/ansible/ansible-lint rev: v24.2.1 hooks: - id: ...
Stefan's user avatar
  • 1,972
1 vote
1 answer
3k views

I have mypy pre-commit hook - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.8.0 hooks: - id: mypy args: - --config-file=./.styleconfigs/mypy.ini ...
unknown's user avatar
  • 331
1 vote
1 answer
2k views

I have a python repository which has a pyproject.toml and a pre-commit-config.yaml The pyproject.toml looks something like this [tool.poetry] name = "projectname" description = "My ...
Saroopashree Kumaraguru's user avatar
0 votes
1 answer
551 views

I have a helms folder structure and am trying to run the kubeconform pre-commit hook to test my yaml files. However, I everytime I run it, the files just get skipped. Project ├── Makefile ├── helms │ ...
user avatar
1 vote
1 answer
2k views

in our project we add a big number of json-like files, which have a json structure, but are named with .meta extension (not a .json). We would like to validate the files against the json-schema before ...
Tomasz Kubat's user avatar
1 vote
1 answer
910 views

I'm using bump2version python module to increment my python codebase version automatically. When the pre-commit hook runs after the commit, the version.sh goes into indefinite loop and version keeps ...
user2439278's user avatar
  • 1,264
1 vote
2 answers
1k views

I have a project using dash to commit, but it fails when I try to commit the following part: @app_dash.callback( Output("output_data_upload", "figure"), [Input("...
H KKK L's user avatar
  • 21

1
2 3 4 5
8