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

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS 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

  • Project mention: Jupyter lab code formatter? | /r/learnpython | 2023-05-14
  • 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

  • Project mention: Do I need to be Admin to get a pre-receive hook working? | /r/gitlab | 2023-05-08

    For example I want to reject poorly formatted commit messages with https://github.com/compilerla/conventional-pre-commit

  • yesqa

    Automatically remove unnecessary `# noqa` comments

  • Project mention: Which is your favourite or go-to YouTube channel for being up-to-date on Python? | /r/Python | 2023-05-05

    He made yesqa and pyupgrade (among others), and also works on flake8. His main job is for https://sentry.io/.

  • 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

  • pre-commit-hook-yamlfmt

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

  • django-urlconfchecks

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

  • 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). The latest post mention was on 2024-03-29.

Python pre-commit related posts

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,006
2 pre-commit-hooks 4,852
3 pyupgrade 3,323
4 nbQA 963
5 reorder-python-imports 709
6 nn-template 612
7 FastAPI-Backend-Template 551
8 mdformat 345
9 conventional-pre-commit 281
10 yesqa 257
11 python-template 228
12 autohooks 183
13 check-jsonschema 176
14 cookiecutter-fastapi-backend 102
15 pre-commit-hook-yamlfmt 55
16 django-urlconfchecks 54
17 flake8-typing-imports 48
18 pre-commit-config-shellcheck 7
19 version-checker 4
20 pushpin 2
21 black-pre-commit-example-setup 0

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com