Skip to content

ci: Add pre-commit hooks and GitHub Actions lint workflow#141

Open
rich7420 wants to merge 2 commits intohao-ai-lab:mainfrom
rich7420:precommit-ci-process
Open

ci: Add pre-commit hooks and GitHub Actions lint workflow#141
rich7420 wants to merge 2 commits intohao-ai-lab:mainfrom
rich7420:precommit-ci-process

Conversation

@rich7420
Copy link

@rich7420 rich7420 commented Feb 6, 2026

Description

Add lint/format automation so every push and PR runs the same checks locally and in CI.

Included: Pre-commit (Ruff, ShellCheck, clang-format, generic hooks) + GitHub Actions workflow (.github/workflows/lint.yml) on push/PR to main and master. Config: pyproject.toml, .clang-format. Docs: docs/DEVELOPMENT.md; README Development section shortened with link and CI badge. .gitignore: .build/, .venv-lint/, Megatron-LM/, TransformerEngine/, models/. Excluded from hooks: Megatron-LM/, TransformerEngine/, .build/.

Code changes for hooks: Shell shebangs and quoting where needed; two baseline scripts excluded from ShellCheck. Python: fixes in pretrain_llama.py and similar (e.g. except Exception, zip(..., strict=True)).

Ignores / follow-up: Many pre-commit violations are currently ignored (Ruff per-file-ignores for tests/playground/baseline and temporarily distca/; rule-level ignores; ShellCheck excludes for a couple of baseline scripts) so CI is green. Plan is to gradually remove ignores and fix issues in follow-up (e.g. distca/ first, then tests/playground).

How to use: pip install pre-commit && pre-commit install. Manual: pre-commit run --all-files.

Checklist

  • Pre-commit runs clean (excluding five internal plan docs)
  • CI on push/PR to main and master
  • Internal plan docs not referenced from other code/docs
  • Follow-up: reduce ignores(a lot need to do) and fix violations (distca/ → tests/playground)

@rich7420
Copy link
Author

rich7420 commented Feb 6, 2026

@GindaChen could you help me to press workflow, please?

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