pre-commit.com Questions
2
How can I source a bash script that contains exports for environment variables?
env.sh
...
export VARIABLE=test
...
test_file.py
...
os.environ['VARIABLE'] # Throws KeyError
...
How can I us...
Terret asked 14/6, 2019 at 17:54
1
Solved
Error message
While using a conda environment and pre-commit I receive the error:
error: Library stubs not installed for "requests" (or incompatible with Python 3.10)
The full erro...
Abelmosk asked 4/9, 2022 at 23:42
2
I am running Mypy v0.910 with pre-commit. It complains that python-dateutil does not have type stubs. However, even after installing the stubs, I get the same error.
My pre-commit config is
default...
Briquet asked 20/10, 2021 at 0:24
5
Solved
I just got Black and Pre-Commit set up for my Django repository.
I used the default config for Black from the tutorial I followed and it's been working great, but I am having trouble excluding my ...
Sandblind asked 24/2, 2020 at 17:36
1
I am struggling to use an environment variable into the arguments section of pre-commit hooks config
following is an example spinet to show what I am trying to do
- repo: https://github.com/return...
Auctorial asked 18/7, 2022 at 8:3
1
Solved
I am trying to run a script with pre-commit hook. Here is my script:
build_script.sh
#! /bin/bash
echo "Stage 1: Preparing CMake configuration"
.pre-commit-config.yaml
fail_fast: false...
Damson asked 7/7, 2022 at 9:49
3
Solved
I am trying to set up pylint to work with pre-commit. I have looked into the docs, but still I am confused. I do not know how to setup .pre-commit-config.yaml properly.
Could you provide the most ...
Nava asked 6/3, 2019 at 12:25
3
Solved
I have some python code formatters as git pre-commit hook and I have changed my python version as
brew list | grep python
[email protected]
[email protected]
brew unlink [email prot...
Priestley asked 3/8, 2021 at 10:53
2
Solved
Following the "non administrative installation" instructions on Pre-Commit's website, I ran the following command:
curl http://pre-commit.com/install-local.py | python
These instructions provide...
Krystakrystal asked 2/6, 2017 at 17:49
1
Solved
I have the following structure for my project:
project/
├── backend
│ ├── api_v1
│ ├── api_v2
│ └── api_v3
└── frontend
Each of the API dirs, api_v1, api_v2, and api_v3, have python files.
I...
Affricative asked 29/3, 2022 at 6:24
2
Solved
I wish pre-commit to run the tests before committing my code.
The command python -m unittest discover is working in the command line.
D:\project_dir>python -m unittest discover
...
...
...
----...
Subdebutante asked 16/12, 2019 at 14:0
2
Solved
I recently uninstalled pre-commit from my environment. I performed the following in pipenv:
pipenv --rm
<deleted Pipfile and Pipfile.lock>
pipenv install -r requirements.txt
I ensured that ...
Baleen asked 23/3, 2022 at 12:28
2
I want to configure black in pre-commit and exclude precommit from checking any migrations folder.
My pyproject.toml looks like this
[tool.black]
line-length = 79
target-version = ['py37']
includ...
Noble asked 4/4, 2020 at 17:48
0
I try to configurate start mypy + django-stubs cheking before commiting. I use pre-commit for it.
When I try to commit, I have error django.core.exceptions.ImproperlyConfigured: Set the POSTGRES_DB...
Chemo asked 1/3, 2022 at 5:10
1
Installed pre-commit successfully using the following command in VSCode:
python3 -m pip install pre-commit --user
but when I try to do the pre-commit install, I get the error message:
zsh: c...
Wallie asked 2/10, 2020 at 17:42
1
Solved
Tox:
https://tox.wiki/en/latest/
pre-commit:
https://pre-commit.com/
I would like to understand the borders for both choices.
I know that pre-commit creates a py environment - same as tox. To me, t...
Jadeite asked 7/2, 2022 at 17:17
1
Solved
I added this to pre-commit-config.yml
- repo: local
hooks:
- id: python-hook
name: python-hook
entry: python python_script.py
language: python
pass_filenames: false
Where python_script.py ha...
Paucker asked 19/1, 2022 at 22:57
2
Solved
As I understand the documentation, whenever I add these lines to the config:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: trailing-whitespace
it makes ...
Fabiolafabiolas asked 12/8, 2021 at 9:28
2
in my Python project I use pytest as a pre-commit hook. Some tests create and delete temporary files, everything works fine when I run pytest <test directory>. However, when I run git commit ...
Ebeneser asked 22/9, 2020 at 13:55
1
Solved
We are using pre-commit to format our Python code using black with the following configuration in .pre-commit-config.yaml:
repos:
- repo: https://github.com/ambv/black
rev: 20.8b1
hooks:
- id: ...
Potable asked 6/10, 2021 at 8:30
1
Solved
I would like to make a Git repo that’s REUSE compliant. I want to use the reuse pre-commit hook to help ensure that I’m compliant. The REUSE Specification requires that I make a folder called “LICE...
Haroldson asked 8/9, 2021 at 15:58
2
Solved
I have a project with a frontend in JS and backend in Python.
Frontend had been configured with husky pre-commit hook.
Today I've configured Pylint with pre-commit library but husky hooks had been ...
Fairish asked 22/9, 2020 at 0:22
1
I'm trying to get pre-commit working at work (I have it working on personal computer). Our security setup will not allow pre-commit to reference external repos and pip install external packages fro...
Virgil asked 1/6, 2021 at 20:59
1
Solved
My team uses Pre-commit in our repositories to run various code checks and formatters. Most of my teammates use it but some skip it entirely by committing with git commit --no-verify. Is there anyw...
If asked 19/5, 2021 at 17:56
3
Solved
I started using Prettier + eslint using pretty-quick & husky (option 2). It behaves as-expected, i.e., reformats code during a commit (or amend) and includes the changes in the commit.
My monor...
Magel asked 11/10, 2020 at 22:49
© 2022 - 2024 — McMap. All rights reserved.