From 615f557f9a93bb5fbc7f0ff6e74eaa9061d9b76b Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Tue, 1 Dec 2026 08:43:44 -0600 Subject: [PATCH] ci: run the CI checks at pre-commit and pre-push Install the pre-push hook type with pre-commit, add the CI checks that were missing locally, and document the setup in README.md and CONTRIBUTING.md. Co-Authored-By: Claude Sonnet 5.5 --- .pre-commit-config.yaml | 13 +++++++++++++ CONTRIBUTING.md | 9 +++++++++ README.md | 8 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aab5ebd..e02fe95 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,4 @@ +default_install_hook_types: [pre-commit, pre-push] repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 @@ -89,3 +90,15 @@ repos: hooks: - id: yamllint args: [--config-file, .yamllint.yml] + + - repo: local + hooks: + - id: devvit-checks + name: devvit type-check, test, build, and parity golden + language: system + entry: >- + bash -c 'cd devvit && npm ci --no-fund --no-audit && npm run type-check && npm test && npm run build + && uv run --no-project --python 3.13 --with praw==8.0.3 python -I test/parity/python_render.py test/parity/fixture.json "$(git rev-parse --show-toplevel)" | diff -u test/parity/golden.md -' + pass_filenames: false + files: ^devvit/ + stages: [pre-push] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..86478f1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,9 @@ +# Contributing + +## Development + +Run `pre-commit install` once per clone to install the commit and push hooks. + +- Commit hooks run lint, format, and type checks, matching CI. +- Push hooks run the tests, matching CI. +- Run everything with `pre-commit run --all-files --hook-stage pre-push`. diff --git a/README.md b/README.md index 4396098..048e7c5 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,14 @@ tail -f /var/log/redditmodlog/.log | Rate limiting | Raise `--interval` and lower `--batch-size` | | Database grows | Lower `--retention-days` | +## Development + +Run `pre-commit install` once per clone to install the commit and push hooks. + +- Commit hooks run lint, format, and type checks, matching CI. +- Push hooks run the tests, matching CI. +- Run everything with `pre-commit run --all-files --hook-stage pre-push`. + ## Contributing Issues and pull requests welcome. See the [contributing guidelines](https://github.com/baker-scripts/.github/blob/main/CONTRIBUTING.md) and [open an issue](https://github.com/baker-scripts/RedditModLog/issues) to discuss larger changes. Include test runs and changes to CLI help output.