From 52d09db764224c0d615c8d824db2330e8f495657 Mon Sep 17 00:00:00 2001 From: tobiichi3227 <86729076+tobiichi3227@users.noreply.github.com> Date: Fri, 21 Feb 2025 01:00:49 +0800 Subject: [PATCH] Chore(Fortune): add pre-commit to check special events (#55) * Chore(Fortune): add pre-commit to check special events * Chore(Fortune): Update pre-commit hook version * Chore(Fortune): replace shell script with Python for better compatibility --- .pre-commit-config.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..e01afb6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,36 @@ +# 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: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + +- repo: local + hooks: + - id: check-cyclical-event + name: check-cyclical-event + entry: python3 scripts/check-events.py fortune_generator/json/cyclical_special.json cyclical + language: python + files: fortune_generator/json/cyclical_special.json + types: [json] + pass_filenames: false + + - id: check-custom-event + name: check-custom-event + entry: python3 scripts/check-events.py fortune_generator/json/custom_special.json custom + language: python + files: fortune_generator/json/custom_special.json + types: [json] + pass_filenames: false + + - id: check-static-event + name: check-static-event + entry: python3 scripts/check-events.py fortune_generator/json/static_special.json static + language: python + files: fortune_generator/json/static_special.json + types: [json] + pass_filenames: false