Skip to main content

Sync pre-commit hook dependencies based on other installed hooks

Project description

sync-pre-commit-deps

Sync pre-commit hook dependencies based on other installed hooks

install (standalone)

pip install sync-pre-commit-deps

install as a pre-commit hook (recommended)

See pre-commit for instructions

Sample .pre-commit-config.yaml:

-   repo: https://github.com/pre-commit/sync-pre-commit-deps
    rev: v0.0.4
    hooks:
    -   id: sync-pre-commit-deps

cli

$ sync-pre-commit-deps path/to/.pre-commit-config.yaml

what it does

Hooks like black, yesqa, and eslint reference additional dependencies which are also pre-commit hooks. This tool syncs the version in additional_dependencies with the version in rev.

For example, flake8 under yesqa is updated from 5.0.0 to 6.0.0 because the flake8 hook uses 6.0.0:

 repos:
 -   repo: https://github.com/PyCQA/flake8
     rev: 6.0.0
     hooks:
     -   id: flake8
 -   repo: https://github.com/asottile/yesqa
     rev: v1.5.0
     hooks:
     -   id: yesqa
         additional_dependencies:
-        -   flake8==5.0.0
+        -   flake8==6.0.0

Another example, the eslint version in additional_dependencies is updated to match the version in rev:

 -   repo: https://github.com/pre-commit/mirrors-eslint
     rev: v4.15.0
     hooks:
     -   id: eslint
         additional_dependencies:
-        -   eslint@4.14.0
+        -   eslint@4.15.0
         -   eslint-config-google@0.7.1
         -   eslint-loader@1.6.1
         -   eslint-plugin-react@6.10.3
         -   babel-eslint@6.1.2

what it doesn't do

  • Does not add new additional dependencies. Only updates versions for dependencies that are already specified.
  • Does not sync versions from package.json, requirements.txt, pyproject.toml, etc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sync_pre_commit_deps-0.0.4.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sync_pre_commit_deps-0.0.4-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sync_pre_commit_deps-0.0.4.tar.gz.

File metadata

  • Download URL: sync_pre_commit_deps-0.0.4.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for sync_pre_commit_deps-0.0.4.tar.gz
Algorithm Hash digest
SHA256 cdfae593a4c46046b981f79e89a9bf5c9c65076f4449b77414509d0c2057e38c
MD5 6aac2717bf1a31a61f9549dc96ae93d6
BLAKE2b-256 ff3063b8cdfc8c427de9fb3c3dd213ffc4e838a9441e1bf884d7ed8dc33cb043

See more details on using hashes here.

File details

Details for the file sync_pre_commit_deps-0.0.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sync_pre_commit_deps-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c8d9091f68a13858ba02cf69dee826788616ce3b3f20098c0cf9fa8a71d027f0
MD5 cb1210c9b9a936dc4f5abd3689aaffe0
BLAKE2b-256 d52d9fc3441950cb32d665699327cf3fe6c2075c1a8a5929fdd0c6d27aaf9c1e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page