ci: Add pre-commit hooks and GitHub Actions lint workflow#141
Open
rich7420 wants to merge 2 commits intohao-ai-lab:mainfrom
Open
ci: Add pre-commit hooks and GitHub Actions lint workflow#141rich7420 wants to merge 2 commits intohao-ai-lab:mainfrom
rich7420 wants to merge 2 commits intohao-ai-lab:mainfrom
Conversation
Author
|
@GindaChen could you help me to press workflow, please? |
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.
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.pyand 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