Skip to content

Add prek pre-commit hooks and CI#587

Merged
kvinwang merged 10 commits intomasterfrom
chore/add-prek-config
Mar 20, 2026
Merged

Add prek pre-commit hooks and CI#587
kvinwang merged 10 commits intomasterfrom
chore/add-prek-config

Conversation

@kvinwang
Copy link
Collaborator

Summary

  • Add prek.toml with pre-commit hooks: trailing whitespace, end-of-file fixer, YAML/TOML/JSON validation, merge conflict detection, large file check, cargo fmt, ruff (lint + format), go vet, shellcheck, and conventional commit messages
  • Add prek-check.yml CI workflow that runs prek on changed files only (via --from-ref/--to-ref)
  • Fix minor lint issues: missing docstring in test_outputs.py, unused variable in vmm-cli.py

Test plan

  • prek run --all-files passes locally (except shellcheck存量warnings)
  • CI workflow triggers on PR and checks only changed files

Add prek.toml with hooks for trailing whitespace, end-of-file, YAML/TOML/JSON
validation, merge conflict detection, large file checks, cargo fmt, ruff
lint+format, go vet, shellcheck, and conventional commit messages.

Fix minor lint issues: add missing docstring in test_outputs.py, remove unused
variable assignment in vmm-cli.py.
@kvinwang kvinwang force-pushed the chore/add-prek-config branch from b971582 to 43e96f1 Compare March 20, 2026 03:44
The sdk/python config has strict docstring rules (D*) that don't apply
to scripts outside sdk/python/. Add a minimal root-level ruff.toml with
basic E/F/I rules only.
Remove root-level ruff.toml; pass lint rules via prek.toml args instead.
Add proper docstrings to vmm-cli.py, ct_monitor.py, add-spdx-attribution.py,
and app.py to comply with pydocstyle rules.
@kvinwang kvinwang changed the title chore: add prek pre-commit hooks and CI Add prek pre-commit hooks and CI Mar 20, 2026
Previous rebase lost newly added functions (discover_vmm_instances,
load_config, etc). Restore master version and reapply: import sorting,
docstrings, line length fixes, and unused variable removal.
@kvinwang kvinwang merged commit 5342e3e into master Mar 20, 2026
17 of 18 checks passed
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.

1 participant