8000 GitHub - andrewaylett/pre-commit-hooks
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

andrewaylett/pre-commit-hooks

Repository files navigation

Andrew's pre-commit hooks

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

Available Hooks

Cog

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

Init hooks

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.

Development

Running Tests

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

0