From 0b31ee45a802e5f200e3c7ee98f5e482584ec3d7 Mon Sep 17 00:00:00 2001 From: tobiichi3227 Date: Tue, 18 Feb 2025 10:44:10 +0800 Subject: [PATCH] Chore(Fortune): replace shell script with Python for better compatibility --- .pre-commit-config.yaml | 26 +++++++++++++++++++++----- scripts/check-events.sh | 7 ------- 2 files changed, 21 insertions(+), 12 deletions(-) delete mode 100755 scripts/check-events.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9384187..e01afb6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,10 +11,26 @@ repos: - 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$ + - 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 diff --git a/scripts/check-events.sh b/scripts/check-events.sh deleted file mode 100755 index 6e9afe8..0000000 --- a/scripts/check-events.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/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