From 1c581c592c5e6c6d04808268168cce286ca46f65 Mon Sep 17 00:00:00 2001
From: "Peter J. A. Cock"
Date: Fri, 13 Jun 2025 14:22:04 +0900
Subject: [PATCH] Add pre-commit setup to catch YAML errors early
---
.pre-commit-config.yaml | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 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 00000000..f974bae8
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,40 @@
+# pre-commit run --all-files
+repos:
+- repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.5.0
+ hooks:
+ - id: check-added-large-files
+ - id: check-case-conflict
+ - id: check-executables-have-shebangs
+ - id: check-json
+ - id: check-merge-conflict
+ - id: check-shebang-scripts-are-executable
+ - id: check-symlinks
+ - id: check-yaml
+ - id: debug-statements
+ - id: destroyed-symlinks
+ - id: end-of-file-fixer
+ files: \.(md|py|sh|rst|yml|yaml)$
+ - id: mixed-line-ending
+ - id: trailing-whitespace
+ files: \.(md|py|sh|rst|yml|yaml)$
+- repo: local
+ hooks:
+ - id: no-tabs
+ name: No tabs
+ description: Reject any files containing a tab
+ entry: '\t'
+ language: pygrep
+ files: \.(md|py|sh|rst|yml|yaml)$
+- repo: https://github.com/codespell-project/codespell
+ rev: v2.2.6
+ hooks:
+ - id: codespell
+ files: \.(md|py|sh|rst|yml|yaml)$
+ci:
+ # Settings for the https://pre-commit.ci/ continuous integration service
+ autofix_prs: true
+ # Default message is more verbose
+ autoupdate_commit_msg: '[pre-commit.ci] autoupdate'
+ # Default is weekly
+ autoupdate_schedule: monthly