Skip to content

Add pre-commit configuration and update documentation#1

Merged
mingcheng merged 1 commit into
mainfrom
chore-add-precommit-lint
Jun 3, 2026
Merged

Add pre-commit configuration and update documentation#1
mingcheng merged 1 commit into
mainfrom
chore-add-precommit-lint

Conversation

@mingcheng

Copy link
Copy Markdown
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>
@mingcheng mingcheng force-pushed the chore-add-precommit-lint branch from 4f97579 to e2557ec Compare June 3, 2026 08:44
@mingcheng mingcheng requested a review from Copilot June 3, 2026 08:44
@mingcheng mingcheng merged commit 06666bb into main Jun 3, 2026
2 checks passed
@mingcheng mingcheng deleted the chore-add-precommit-lint branch June 3, 2026 08:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.yaml defining 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, and SECURITY.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 thread .pre-commit-config.yaml
Comment on lines +18 to +20
- id: check-yaml
files: \.(yaml|yml)$
exclude: \.github/workflows/
Comment thread .pre-commit-config.yaml
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 thread .pre-commit-config.yaml
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 thread .pre-commit-config.yaml
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 thread .pre-commit-config.yaml
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 thread .pre-commit-config.yaml
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants