[Apply lint] Add PR-only pre-commit workflow & lint all#169
Merged
Conversation
* Refine pre-commit hook stages and ruff Add default_stages and explicitly set stages for hooks so checks that don't modify files can run in both pre-commit and manual/CI, while modifiers run only locally. Reorganize and document ruff hooks into local autofix/write entries (runs with --fix/unsafe-fixes and format write) and CI check-only entries (output-format=github, --check/--diff). Also set stages for pyproject-fmt and validate-pyproject, add check-* hooks to pre-commit/manual, and clarify behavior with inline comments. * [lint apply] Add PR-only pre-commit workflow Add .github/workflows/format.yml: a GitHub Actions workflow that runs pre-commit only for changed files in PRs. It triggers on pull_request (opened, synchronize, reopened), uses a detect_changes job to checkout full history and compute the list of files changed against the base branch, and exposes that list as an output. A precommit job (guarded by a condition that changed files exist) checks out the PR branch, sets up Python 3.12, installs pre-commit, and runs pre-commit only on the changed files. * Run pre-commit on all files Manual fixes: - Reordered some __init__ calls and added some __all__ - Added tensorrt import best-effort in one file - __init__.py ignores E402 due to requiring registry update * Update format.yml * Use multiline GITHUB_OUTPUT for changed files Replace the single-line echo that wrote CHANGED_FILES to $GITHUB_OUTPUT with a here-document (key<<EOF ... EOF) to correctly export multi-line file lists. This preserves newlines and spaces in the changed-files output so downstream workflow steps receive the full list. * Update format.yml * Fix circular import * Fix all E501 * Export Engine for public acccess
deruyter92
approved these changes
Mar 10, 2026
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.
Add .github/workflows/format.yml
GitHub Actions workflow that runs pre-commit only for changed files in PRs.
It triggers on pull_request (opened, synchronize, reopened), uses a detect_changes job to checkout full history and compute the list of files changed against the base branch, and exposes that list as an output.
A precommit job (guarded by a condition that changed files exist) checks out the PR branch, sets up Python 3.12, installs pre-commit, and runs pre-commit only on the changed files.