Skip to content

Add Code Format Check CI (yapf + ruff)#3

Open
pandacooming wants to merge 1 commit intodeepseek-ai:mainfrom
pandacooming:add-format-ci
Open

Add Code Format Check CI (yapf + ruff)#3
pandacooming wants to merge 1 commit intodeepseek-ai:mainfrom
pandacooming:add-format-ci

Conversation

@pandacooming
Copy link
Copy Markdown

Summary

Add GitHub Actions CI for code format checking (yapf + ruff) and a local format.sh script, following the conventions already used in deepseek-ai/DeepEP.

Changes

  • .github/workflows/format.yml: GitHub Actions workflow that runs format.sh on every push to main and on every pull request.
  • format.sh: Local formatting script that:
    • Runs yapf to format Python files
    • Runs ruff to lint Python files
    • Checks only files changed vs origin/main (or all files with --all)
    • Exits with code 1 if any files need reformatting

Design Decisions

  • Python-only: TileKernels contains only .py files, so clang-format is not included (unlike DeepEP which has C/CUDA).
  • Ruff version: Pinned to >=0.6.0 (TileKernels pyproject.toml already has a ruff config).
  • YAPF version: Pinned to 0.40.2 to match DeepEP.
  • CI cache: Uses actions/setup-python built-in pip cache to speed up installs.

Testing

The script was tested locally:

  1. Clean state: bash format.sh exits 0 when no files need reformatting ✅
  2. New bad formatting: Introducing badly-formatted new code causes the script to exit 1 and list the affected files ✅
  3. No forced reformatting: Existing codebase files are not reformatted by this PR (format-on-push only happens after merge)

- Add .github/workflows/format.yml: GitHub Actions workflow that runs
  yapf + ruff on every push to main and on every PR.
- Add format.sh: local formatting script (used by CI and for
  contributors to run locally before pushing).

Both files follow the same conventions as deepseek-ai/DeepEP.
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