Add pre-commit configuration and update documentation#1
Merged
Conversation
mingcheng
commented
Jun 3, 2026
Contributor
- Introduced pre-commit checks in the GitHub Actions workflow to automate code quality checks on pull requests.
- Created a pre-commit configuration file to define hooks for linting, formatting, and validating commit messages.
- Updated README.md, REPOSITORIES.md, ROADMAP.md, and SECURITY.md for improved clarity and formatting.
- add pre-commit hooks for code quality checks including clang-format, ruff, and mdformat - configure GitHub Actions workflow to run pre-commit checks on pull requests - add conventional commit message validation in CI pipeline - wrap long lines in markdown documentation files for consistency Signed-off-by: mingcheng <mingcheng@apache.org>
4f97579 to
e2557ec
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces repository-wide automated quality checks by adding a pre-commit configuration and a GitHub Actions workflow to run those checks on pull requests, along with Markdown formatting cleanups across several community documents.
Changes:
- Added a new
.pre-commit-config.yamldefining formatting/linting hooks and a Conventional Commits check. - Added a new GitHub Actions workflow to run pre-commit hooks and validate commit messages on PRs.
- Reflowed/cleaned up formatting in
README.md,REPOSITORIES.md,ROADMAP.md, andSECURITY.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
SECURITY.md |
Rewrapped lines for readability without changing policy meaning. |
ROADMAP.md |
Rewrapped paragraphs/list items for consistent formatting. |
REPOSITORIES.md |
Rewrapped lines for readability. |
README.md |
Rewrapped list and license text for consistent formatting. |
.pre-commit-config.yaml |
Added pre-commit hooks configuration (includes several hooks not applicable to this repo). |
.github/workflows/pre-commit.yml |
Added CI workflow to run pre-commit and validate commit messages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+18
to
+20
| - id: check-yaml | ||
| files: \.(yaml|yml)$ | ||
| exclude: \.github/workflows/ |
Comment on lines
+67
to
+78
| # Check consistency between pyproject.toml variants (sglang vs vllm) | ||
| - repo: local | ||
| hooks: | ||
| - id: check-pyproject-consistency | ||
| name: Check pyproject.toml consistency | ||
| entry: python3 areal/tools/check_pyproject_consistency.py | ||
| language: system | ||
| files: ^pyproject(\.vllm)?\.toml$ | ||
| pass_filenames: false | ||
| always_run: false | ||
| require_serial: true | ||
|
|
Comment on lines
+79
to
+90
| # Regenerate uv lockfiles when pyproject files change | ||
| - repo: local | ||
| hooks: | ||
| - id: uv-lock | ||
| name: Regenerate uv lockfiles | ||
| entry: bash scripts/uv_lock.sh | ||
| language: system | ||
| files: ^pyproject(\.vllm)?\.toml$ | ||
| pass_filenames: false | ||
| always_run: false | ||
| require_serial: true | ||
|
|
Comment on lines
+91
to
+102
| # Generate CLI documentation | ||
| - repo: local | ||
| hooks: | ||
| - id: generate-cli-docs | ||
| name: Generate CLI documentation | ||
| entry: python docs/generate_cli_docs.py | ||
| language: system | ||
| files: ^(areal/api/cli_args\.py|docs/generate_cli_docs\.py)$ | ||
| pass_filenames: false | ||
| always_run: false | ||
| require_serial: true | ||
|
|
Comment on lines
+103
to
+112
| # Ensure SPDX license header in Python source files | ||
| - repo: local | ||
| hooks: | ||
| - id: check-license-header | ||
| name: Check SPDX license header | ||
| entry: python3 areal/tools/check_license_header.py | ||
| language: system | ||
| files: ^areal/.*\.py$ | ||
| types: [python] | ||
|
|
Comment on lines
+113
to
+124
| # Format and lint .github/CODEOWNERS | ||
| - repo: local | ||
| hooks: | ||
| - id: format-codeowners | ||
| name: Format CODEOWNERS | ||
| entry: python3 areal/tools/format_codeowners.py | ||
| language: system | ||
| files: ^\.github/CODEOWNERS$ | ||
| pass_filenames: false | ||
| always_run: false | ||
| require_serial: true | ||
|
|
Comment on lines
+25
to
+28
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| version: "0.9.18" |
Comment on lines
+32
to
+35
| pip install pre-commit | ||
| # generate-cli-docs requires the full areal package (language: system), | ||
| # which is not installed in CI. Skip it here; it runs locally instead. | ||
| SKIP=generate-cli-docs pre-commit run --all-files |
Comment on lines
+39
to
+48
| pip install conventional-pre-commit | ||
| FAILED=0 | ||
| for SHA in $(git log --no-merges --format=%H origin/${{ github.base_ref }}..HEAD); do | ||
| git log --format=%B -1 "$SHA" > /tmp/commit_msg | ||
| if ! conventional-pre-commit feat fix docs gov style refactor perf test build ci chore revert /tmp/commit_msg; then | ||
| echo "❌ Bad commit: $(git log --format=%s -1 "$SHA")" | ||
| FAILED=1 | ||
| fi | ||
| done | ||
| exit $FAILED |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.