🌐
pre-commit
pre-commit.com
pre-commit
Here's an example configuration with a few local hooks: - repo: local hooks: - id: pylint name: pylint entry: pylint language: unsupported types: [python] require_serial: true - id: check-x name: Check X entry: ./bin/check-x.sh language: unsupported_script files: \.x$ - id: scss-lint name: scss-lint entry: scss-lint language: ruby language_version: 2.1.5 types: [scss] additional_dependencies: ['scss_lint:0.52.0']
🌐
Medium
medium.com › internet-of-technology › beautify-your-python-code-with-pre-commit-linters-a-step-by-step-guide-d63604d6120b
Pre-commit for Python | Internet of Technology
August 13, 2024 - Getting started with Pre-commit and Pre-commit linter configuration for new Python developers. Pre-commit linter with flake8, black, and isort.
Discussions

How to run a local python file
Hi, I am sorry if this is obvious but I am trying to run a simple python file for our project using pre-commit. Essentially I want a git prehook to create a csv file every time it gets committed. S... More on github.com
🌐 github.com
4
December 18, 2019
What are your favourite pre-commit hooks and why?
You may fancy me mad, but this is my standard python pre-commit stack: end-of-file-fixer trailing-whitespace fix-byte-order-marker mixed-line-ending name-tests-test no-commit-to-branch autoflake args: [ "--in-place", "--remove-unused-variables", "--remove-all-unused-imports" ] isort black cspell doc8 args: [ "--max-line-length", "112", "--file-encoding", "utf-8" ] flake8 additional_dependencies: [ flake8-pytest-style, flake8-bugbear, flake8-comprehensions, flake8-print, darglint ] bandit pylint More on reddit.com
🌐 r/Python
83
120
April 24, 2024
pre commit.com - Should I install `pre-commit` into a python virtual environment or python global environment? - Stack Overflow
When I have a new python package ... with python -m venv .venv. I activate the venv using .venv\Scripts\activate. When working on the package I install package dependencies such as numpy with (.venv) C:\...\my_package> pip install numpy. I am trying to figure out how I should install the pre-commit package so ... More on stackoverflow.com
🌐 stackoverflow.com
Using pre-commit hooks makes software development life easier
I find pre-commits very useful for the reason you mentioned in your other reply: failing fast (or shift left) philosophies. If there is a linting issue, it should be spotted before any CI is triggered. I use pre-commit when working with python with black (auto format), isort (for import sorting), flake8 (linting), and sometimes mypy for type checking. I disagree with the other comment about having save hooks on the ide because I save on every line change even if the change at that point would break everything. So it wouldn't make sense to perform any of the checks I perform with the pre-commit at that point. It's just a useful tool to use, it means CI runners aren't wasting time or compute resources failing jobs for things that could have been spotted before the commit was pushed. Yeah you can bypass, but that's why I will have the lint checks on the CI job too, it just means these checks are less likely to fail. More on reddit.com
🌐 r/programming
11
8
June 22, 2021
🌐
PyPI
pypi.org › project › pre-commit
pre-commit · PyPI
Details for the file pre_commit-4.6.0-py2.py3-none-any.whl.
      » pip install pre-commit
    
Published   Apr 21, 2026
Version   4.6.0
🌐
DEV Community
dev.to › techishdeep › maximize-your-python-efficiency-with-pre-commit-a-complete-but-concise-guide-39a5
The Power of Pre-Commit for Python Developers: Tips and Best Practices - DEV Community
May 1, 2023 - We have already seen an example of how to write a pre-commit hook configuration. Now, let's delve deeper into it. Firstly, let's take another look at the sample configuration. repos: - repo: https://github.com/PyCQA/flake8 rev: 3.9.2 hooks: - id: flake8 name: flake8 types: [python] args: - --max-line-length=88 - --ignore=E203,E501,W503
🌐
GitHub
github.com › pre-commit › pre-commit
GitHub - pre-commit/pre-commit: A framework for managing and maintaining multi-language pre-commit hooks. · GitHub
A framework for managing and maintaining multi-language pre-commit hooks. - pre-commit/pre-commit
Starred by 15.2K users
Forked by 961 users
Languages   Python 97.4% | R 2.0% | Shell 0.5% | Dockerfile 0.1% | Lua 0.0% | Ruby 0.0%
🌐
Scaling Celeste Mountain I
ljvmiranda921.github.io › notebook › 2018 › 06 › 21 › precommits-using-black-and-flake8
Automate Python workflow using pre-commits: black and flake8
June 21, 2018 - In this short post, I’ll describe how I created a pre-commit pipeline in PySwarms using the black code formatter, flake8 checker, and the pre-commit Python framework.
🌐
Medium
medium.com › @anton-k. › how-to-set-up-pre-commit-hooks-with-python-2b512290436
How to set up pre-commit hooks with Python? | by Anton K | Medium
April 26, 2022 - How to set up pre-commit hooks with Python? Git comes with a handy tool to keep your code clean and shaped. Pre-commit hooks are scripts you can run at a certain point. Most of them help us detect …
🌐
GitHub
github.com › pre-commit › pre-commit › issues › 1245
How to run a local python file · Issue #1245 · pre-commit/pre-commit
December 18, 2019 - Hi, I am sorry if this is obvious but I am trying to run a simple python file for our project using pre-commit. Essentially I want a git prehook to create a csv file every time it gets committed. So this prehook has nothing to do with th...
Author   drummerboy2543
Find elsewhere
🌐
Poetry
python-poetry.org › docs › pre-commit-hooks
pre-commit hooks | Documentation | Poetry - Python dependency management and packaging made easy
A .pre-commit-config.yaml example for a monorepo setup or if the pyproject.toml file is not in the root directory:
🌐
Towards Data Science
towardsdatascience.com › home › latest › custom pre-commit hooks for safer code changes
Custom pre-commit hooks for safer code changes | Towards Data Science
January 22, 2025 - The preferred way of working with pre-commit hooks is through the pre-commit Python library. We can set it up with the following steps: Create a git repository for your project with git init · Install the pre-commit library with pip install pre-commit · Add a .pre-commit-config.yaml to your repository. Here’s an example:
🌐
Talk Python To Me
talkpython.fm › episodes › show › 482 › pre-commit-hooks-for-python-devs
Episode #482 - Pre-commit Hooks for Python Devs | Talk Python To Me Podcast
October 24, 2024 - Stefanie’s focus on automated code quality checks led her to develop and share various pre-commit hooks, including a specialized one for NumPy docstrings and another for stripping EXIF metadata from images. Check out our course Up and Running with Git: While you don’t need deep Python expertise to use pre-commit hooks, having basic Git and Python knowledge will help you configure them effectively.
🌐
Gitlab
gdevops.gitlab.io › tuto_git › tools › pre-commit › pre-commit.html
pre-commit : a Python framework for managing and ...
March 2, 2023 - This User ID will be used as a unique identifier while storing and accessing your preferences for future.
🌐
Stefanie Molin
stefaniemolin.com › articles › devx › pre-commit › setup-guide
How to Set Up Pre-Commit Hooks | Stefanie Molin
December 7, 2025 - The pre-commit hooks that we will use in this tutorial run checks on configuration files (like YAML and TOML) and Python files. To make it easier to follow along, I have created a small GitHub template repository at stefmolin/pre-commit-example with a Python package skeleton for a dummy package called example, but you can also use a Python project of your own.
🌐
Python for Data Science
python4data.science › en › latest › productive › git › advanced › hooks › pre-commit.html
pre-commit framework - Python for Data Science
1 week ago - pre-commit is a framework for managing and maintaining multilingual commit hooks. An essential task is to make the same scripts available to the entire development team. pre-commit by yelp manages ...
🌐
Towards Data Science
towardsdatascience.com › home › latest › pre-commit & git hooks: automate high code quality
Pre-Commit & Git Hooks: Automate High Code Quality | Towards Data Science
January 16, 2025 - My .pre-commit-config.yaml looks like this, which is slightly different to the template I showed earlier. repos: - repo: local hooks: - id: lint name: lint entry: make lint language: python types: [python] stages: [commit]
🌐
GitHooks
githooks.com
Learn how to improve your Git skills
git-pre-commit-hook - Hook that blocks bad commits. Useful for Python-development.
🌐
Better Programming
betterprogramming.pub › 2-use-cases-of-python-pre-commit-hooks-to-tidy-up-your-git-repositories-8d86c9c4f06b
2 Use Cases of Python Pre-commit Hooks to Tidy Up Your Git Repositories | by Eldad Uzman | Better Programming
April 13, 2022 - git commit -m "good commit">>> jupyter-nb-clear-output..................................................Failed - hook id: jupyter-nb-clear-output - exit code: 1C:\workspace-vscode\pre-commit-demo\venv\Scripts\python.EXE: No module named nbconvert
🌐
Python for Data Science
python4data.science › en › latest › productive › git › advanced › hooks › ci.html
pre-commit in CI pipelines - Python for Data Science
March 2, 2025 - Alternative configuration as a GitHub workflow, for example: name: pre-commit on: pull_request: push: branches: [main] jobs: pre-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - uses: actions/cache@v4 with: path: ~/.cache/pre-commit key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} - uses: pre-commit/action@v3.0.1 ·