Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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]
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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`.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ tail -f /var/log/redditmodlog/<subreddit>.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.
Expand Down