Add this repo to your .pre-commit-config.yaml
:
repos:
- repo: https://github.com/andrewaylett/pre-commit-hooks
rev: v0.2.0
hooks:
- id: cog
- id: init-hooks
repos:
- repo: https://github.com/andrewaylett/pre-commit-hooks
rev: v0.2.0
hooks:
- id: cog
Runs cog against your README.md
, README
,
or if a file named .cogfiles
exists, all files listed in that file.
The equivalent local incantation would be:
cog -r -c -p "import subprocess as sp, re, os, sys, pathlib as pl, cog" README.md
repos:
- repo: https://github.com/andrewaylett/pre-commit-hooks
rev: v0.2.0
hooks:
- id: init-hooks
Ensures that a baseline set of pre-commit hooks are enabled in the repository, along with their support files.
- .pre-commit-config.yaml
- trailing-whitespace
- end-of-file-fixer
- check-case-conflict
- check-merge-conflict
- check-yaml
- check-toml
- check-xml
- check-added-large-files
- forbid-submodules
- mixed-line-ending
- yamlfmt
- editorconfig-checker
- init-hooks
- If
.github/workflows
directory exists:- actionlint
- check-github-workflows
- If
renovate.json
file exists:- check-renovate
- .editorconfig
- Basic settings
- .yamlfmt.yaml
- Basic settings
- .gitignore
- Basic settings
If the files don't exist, they'll be created with sensible defaults. If the files already exist, but are missing entries, the missing entries will be added.
This project uses pytest for testing. To run the tests:
uv run pytest
The test suite includes:
- Tests for the pre-commit hook functionality
- Tests for cog-generated content