diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..83b8038 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,20 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + +- repo: local + hooks: + - id: check-special-event + name: check-special-event + entry: bash scripts/check-events.sh + language: system + files: ^fortune_generator/json/.*_special\.json$ + types: [json] + pass_filenames: false diff --git a/scripts/check-events.sh b/scripts/check-events.sh new file mode 100755 index 0000000..6e9afe8 --- /dev/null +++ b/scripts/check-events.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +python3 scripts/check-events.py fortune_generator/json/custom_special.json custom +python3 scripts/check-events.py fortune_generator/json/cyclical_special.json cyclical +python3 scripts/check-events.py fortune_generator/json/static_special.json static