Chore(Fortune): add pre-commit to check special events
This commit is contained in:
20
.pre-commit-config.yaml
Normal file
20
.pre-commit-config.yaml
Normal file
@@ -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
|
||||
7
scripts/check-events.sh
Executable file
7
scripts/check-events.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user