Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-commit hook for validating release notes #937

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's using this file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This yaml is used by the pre-commit tool framework for managing pre-commit hooks. Pre-commit hooks run automatically before a commit is finalized. It requires the installation of pre-commit tool in the local environment

- repo: local
hooks:
- id: validate-release-notes
name: Validate Release Notes
entry: python ci/check-release-notes.py
language: python
files: ^release-notes/.*\.yml$
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about now we make this config use make syntax-check? That way it'll check more than just release notes.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: syntax-check
.PHONY: syntax-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]))'

.PHONY: print-rollouts
@find release-notes -iname '*.yaml' | sort | xargs -n1 python3 ci/check-release-notes.py
print-rollouts:
@find updates -iname '*.json' -printf '%f\n' | cut -f1 -d. | sort | xargs ./rollout.py print
aaradhak marked this conversation as resolved.
Show resolved Hide resolved
Loading