← Winnitude! Search  ·  Reader Mode (1253 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 53 LINKS

GitHub - pre-commit/sync-pre-commit-deps: Sync pre-commit hook dependencies based on other installed hooks

Repository navigation

sync-pre-commit-deps
Public

About

Sync pre-commit hook dependencies based on other installed hooks

Topics

pre-commit pre-commit-hooks

Resources

Readme MIT license

Security policy

Security policy Activity Custom properties

Stars

31 stars

Watchers

2 watching

Forks

7 forks Report repository
Branches

Tags
Go to Branches page Go to Tags page

Latest commit

 

History


163 Commits
View commit history for this file.

Folders and files

Name Name Last commit message Last commit date
.github/ workflows .github/ workflows    
tests tests    
.gitignore .gitignore    
.pre-commit-config.yaml .pre-commit-config.yaml    
.pre-commit-hooks.yaml .pre-commit-hooks.yaml    
LICENSE LICENSE    
README.md README.md    
requirements-dev.txt requirements-dev.txt    
setup.cfg setup.cfg    
setup.py setup.py    
sync_pre_commit_deps.py sync_pre_commit_deps.py    
tox.ini tox.ini    

Repository files navigation

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.5
    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.

About

Sync pre-commit hook dependencies based on other installed hooks

Topics

pre-commit pre-commit-hooks

Resources

Readme MIT license

Security policy

Security policy Activity Custom properties

Stars

31 stars

Watchers

2 watching

Forks

7 forks Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages