Skip to content

Commit b32a085

Browse files
committed
docs: add pre-commit hook for automated configuration generation
1 parent 55de066 commit b32a085

3 files changed

Lines changed: 36 additions & 22 deletions

File tree

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,13 @@ repos:
99
rev: v0.8.1
1010
hooks:
1111
- id: ruff-format
12+
13+
- repo: local
14+
hooks:
15+
- id: pydantic-settings-export
16+
name: Generate config documentation
17+
entry: bash -c 'PYTHONPATH=$PWD pydantic-settings-export && python -c "import re; content = open(\"CONFIGURATION.md\").read(); content = re.sub(r\"/home/[^/]+/[^|]+/app\", \"./app\", content); open(\"CONFIGURATION.md\", \"w\").write(content)"'
18+
language: system
19+
# only run this hook if settings have changed
20+
files: ^app/core/config\.py$
21+
pass_filenames: false

0 commit comments

Comments
 (0)