Python pre-commit

Open-source Python projects categorized as pre-commit

Top 21 Python pre-commit Projects

  • pre-commit

    A framework for managing and maintaining multi-language pre-commit hooks.

  • Project mention: How to setup Black and pre-commit in python for auto text-formatting on commit | dev.to | 2024-03-29

    Today we are going to look at how to setup Black (a python code formatter) and pre-commit (a package for handling git hooks in python) to automatically format you code on commit.

  • pre-commit-hooks

    Some out-of-the-box hooks for pre-commit

  • Project mention: Implementing Quality Checks In Your Git Workflow With Hooks and pre-commit | dev.to | 2023-12-13

    # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-toml - id: check-added-large-files - repo: local hooks: - id: tox lint name: tox-validation entry: pdm run tox -e test,lint language: system files: ^src\/.+py$|pyproject.toml|^tests\/.+py$ types_or: [python, toml] pass_filenames: false - id: tox docs name: tox-docs language: system entry: pdm run tox -e docs types_or: [python, rst, toml] files: ^src\/.+py$|pyproject.toml|^docs\/ pass_filenames: false - repo: https://github.com/pdm-project/pdm rev: 2.10.4 # a PDM release exposing the hook hooks: - id: pdm-lock-check - repo: https://github.com/jumanjihouse/pre-commit-hooks rev: 3.0.0 hooks: - id: markdownlint

  • Scout Monitoring

    Free Django app performance insights with Scout Monitoring. Get Scout setup in minutes, and let us sweat the small stuff. A couple lines in settings.py is all you need to start monitoring your apps. Sign up for our free tier today.

    Scout Monitoring logo
  • pyupgrade

    A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.

  • Project mention: A Tale of Two Kitchens - Hypermodernizing Your Python Code Base | dev.to | 2023-11-12

    pyupgrade and flynt are examples of tools that modify your code base from earlier python versions into the newest python syntax, rewriting all string formats into f-strings and similar things.

  • nbQA

    Run ruff, isort, pyupgrade, mypy, pylint, flake8, and more on Jupyter Notebooks

  • reorder-python-imports

    Rewrites source to reorder python imports

  • nn-template

    Generic template to bootstrap your PyTorch project.

  • FastAPI-Backend-Template

    A backend project template with FastAPI, PostgreSQL with asynchronous SQLAlchemy 2.0, Alembic for asynchronous database migration, and Docker. (by Aeternalis-Ingenium)

  • Project mention: Automate Python Linting and Code Style Enforcement with Ruff and GitHub Actions | dev.to | 2023-07-22
  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • mdformat

    CommonMark compliant Markdown formatter

  • Project mention: Formatting on save not working | /r/HelixEditor | 2023-07-05

    [[language]] name = "python" roots = ["pyproject.toml"] formatter = { command = "black", args = ["--quiet", "-"] } language-server = { command = "pyright-langserver", args = ["--stdio"] } config = {} auto-format = true [[language]] name = "rust" auto-format = true # [[language]] # name = "typescript" # auto-format = true # formatter = { command = "prettier", args = ["--parser", "typescript"]} # # pass format options according to https://github.com/typescript-language-server/typescript-language-server#workspacedidchangeconfiguration omitting the "[language].format." prefix. # config = { format = { "semicolons" = "insert", "insertSpaceBeforeFunctionParenthesis" = true } } [[language]] name = "tsx" formatter = { command = 'prettier', args = ["--parser", "typescript"] } auto-format = true [[language]] name = "javascript" auto-format = true formatter = { command = 'npx', args = ["prettier", "--config", ".prettierrc", "--parser", "javascript"] } # formatter = { command = "prettier", args = ["--parser", "javascript"]} [[language]] name = "css" formatter = { command = 'prettier', args = ["--parser", "css"] } [[language]] name = "markdown" # https://github.com/executablebooks/mdformat formatter = { command = "mdformat", args = ["-"] } [[language]] name = "json" formatter = { command = "prettier", args = ["--parser", "json"] } [[language]] name = "toml" auto-format = true # https://github.com/bd82/toml-tools/tree/master/packages/prettier-plugin-toml formatter = { command = "prettier", args = ["--parser", "toml"] } [[language]] name = "yaml" indent = { tab-width = 2, unit = " " } formatter = { command = "prettier", args = ["--parser", "yaml"] } [[language]] name = "astro" scope = "source.astro" injection-regex = "astro" file-types = ["astro"] roots = ["package.json", "astro.config.mjs"] language-server = { command = "astro-ls", args = ["--stdio"] } config = { "typescript" = { serverPath = "/Users/matteostara/.nvm/versions/node/v18.16.0/bin/typescript-language-server" }, "environment" = "node" }

  • conventional-pre-commit

    A pre-commit hook that checks commit messages for Conventional Commits formatting

  • yesqa

    Automatically remove unnecessary `# noqa` comments

  • python-template

    Python project and library template for clean, reliable, open-source projects.

  • Project mention: Template for Cython + Poetry + PoetryDynamicVersioning + GithubActions + CIBuildWheel | /r/Python | 2023-06-08
  • autohooks

    Library for managing git hooks

  • check-jsonschema

    A CLI and set of pre-commit hooks for jsonschema validation with built-in support for GitHub Workflows, Renovate, Azure Pipelines, and more!

  • cookiecutter-fastapi-backend

    :cookie: Cookiecutter template to build and deploy fastapi backends..batteries included

  • django-urlconfchecks

    A package for type-checking the URLs and associated views for Django

  • pre-commit-hook-yamlfmt

    YAML formatter for http://pre-commit.com

  • flake8-typing-imports

    flake8 plugin which checks that typing imports are properly guarded

  • pre-commit-config-shellcheck

    Tool for checking entry points in the pre-commit config with ShellCheck.

  • version-checker

    pre-commit hook: make sure your package doesn't refer to different versions of itself across the codebase āœ… (by jalvaradosegura)

  • pushpin

    Git hooks for python šŸ“Œ (by daun-io)

  • black-pre-commit-example-setup

    Example repo for article showing how to setup Black and pre-commit for text-formatting in python

  • Project mention: How to setup Black and pre-commit in python for auto text-formatting on commit | dev.to | 2024-03-29

    All the Code used in this article can be found on this GitHub repo here

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

Python pre-commit related posts

  • How to setup Black and pre-commit in python for auto text-formatting on commit

    3 projects | dev.to | 29 Mar 2024
  • Implementing Quality Checks In Your Git Workflow With Hooks and pre-commit

    6 projects | dev.to | 13 Dec 2023
  • [Tool Anouncement] github-distributed-owners - A tool for managing GitHub CODEOWNERS using OWNERS files distributed throughout your code base. Especially helpful for monorepos / multi-team repos

    2 projects | /r/github | 13 Sep 2023
  • Packaging Python projects in 2023 from scratch

    2 projects | /r/Python | 6 Sep 2023
  • How to Write Impeccably Clean Code That Will Save Your Sanity

    7 projects | dev.to | 27 Jul 2023
  • Setting Up Pre-Commit Hooks in GitHub: Ensuring Code Quality and Consistency

    4 projects | dev.to | 11 Jul 2023
  • Iā€™m a hack and a fraud - what are some dead giveaways that someone is self taught?

    1 project | /r/learnpython | 11 Jul 2023
  • A note from our sponsor - SaaSHub
    www.saashub.com | 7 Jun 2024
    SaaSHub helps you find the best software and product alternatives Learn more ā†’

Index

What are some of the best open-source pre-commit projects in Python? This list will help you:

Project Stars
1 pre-commit 12,248
2 pre-commit-hooks 4,951
3 pyupgrade 3,363
4 nbQA 979
5 reorder-python-imports 712
6 nn-template 620
7 FastAPI-Backend-Template 575
8 mdformat 367
9 conventional-pre-commit 296
10 yesqa 258
11 python-template 246
12 autohooks 184
13 check-jsonschema 182
14 cookiecutter-fastapi-backend 109
15 django-urlconfchecks 56
16 pre-commit-hook-yamlfmt 55
17 flake8-typing-imports 47
18 pre-commit-config-shellcheck 8
19 version-checker 5
20 pushpin 2
21 black-pre-commit-example-setup 0

Sponsored
Free Django app performance insights with Scout Monitoring
Get Scout setup in minutes, and let us sweat the small stuff. A couple lines in settings.py is all you need to start monitoring your apps. Sign up for our free tier today.
www.scoutapm.com