https://github.com/pre-commit/sync-pre-commit-deps
Sync pre-commit hook dependencies based on other installed hooks
https://github.com/pre-commit/sync-pre-commit-deps
pre-commit pre-commit-hooks
Last synced: 3 months ago
JSON representation
Sync pre-commit hook dependencies based on other installed hooks
- Host: GitHub
- URL: https://github.com/pre-commit/sync-pre-commit-deps
- Owner: pre-commit
- License: mit
- Created: 2023-07-11T14:24:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-15T20:38:34.000Z (3 months ago)
- Last Synced: 2025-09-16T12:56:05.285Z (3 months ago)
- Topics: pre-commit, pre-commit-hooks
- Language: Python
- Homepage:
- Size: 95.7 KB
- Stars: 22
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
sync-pre-commit-deps
====================
Sync pre-commit hook dependencies based on other installed hooks
## install (standalone)
```bash
pip install sync-pre-commit-deps
```
## install as a pre-commit hook (recommended)
See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions
Sample `.pre-commit-config.yaml`:
```yaml
- repo: https://github.com/pre-commit/sync-pre-commit-deps
rev: v0.0.3
hooks:
- id: sync-pre-commit-deps
```
## cli
```console
$ sync-pre-commit-deps path/to/.pre-commit-config.yaml
```
## what it does
Ensures tools which declare `flake8`, `black`, or `mypy` as additional dependencies will have those versions synced with the `flake8`, `black`, or `mypy` versions in the rest of the config. For example, `flake8` under `yesqa` is updated from `5.0.0` to `6.0.0`.
```diff
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
```