Skip to content

Commit

Permalink
Add pre-commit hook for validating release notes
Browse files Browse the repository at this point in the history
- This is a pre-commit hook using `pre-commit` framework to validate release notes YAML files.
- The hook checks for correct structure, formatting and required fields in the `release-notes` directory.
- This ensures consistency in release notes before committing changes.
- Added release notes validation to the `make syntax-check` target

Ref: #934 (comment)
  • Loading branch information
aaradhak committed Aug 19, 2024
1 parent 9aee93a commit 9435866
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: local
hooks:
- id: validate-release-notes
name: Validate Release Notes
entry: python ci/check-release-notes.py
language: python
files: ^release-notes/.*\.yml$
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.PHONY: syntax-check
.PHONY: syntax-check pre-commit-check print-rollouts

syntax-check:
@find streams updates -iname '*.json' | sort | xargs -n 1 python3 -c 'import json, sys; json.load(open(sys.argv[1]))'
@python ci/check-release-notes.py release-notes/*.yml

.PHONY: print-rollouts
print-rollouts:
@find updates -iname '*.json' -printf '%f\n' | cut -f1 -d. | sort | xargs ./rollout.py print

0 comments on commit 9435866

Please sign in to comment.