Skip to content

Add lintrunner pre-commit hook#18689

Open
abhinaykukkadapu wants to merge 1 commit intopytorch:mainfrom
abhinaykukkadapu:lintrunner-pre-commit-hook
Open

Add lintrunner pre-commit hook#18689
abhinaykukkadapu wants to merge 1 commit intopytorch:mainfrom
abhinaykukkadapu:lintrunner-pre-commit-hook

Conversation

@abhinaykukkadapu
Copy link
Copy Markdown
Contributor

@abhinaykukkadapu abhinaykukkadapu commented Apr 3, 2026

Add lintrunner pre-commit hook

Summary:
Run lintrunner automatically on every commit via .githooks/pre-commit.
Hooks are enabled by default through install_executorch.sh.

Test Plan:

  • lintrunner not installed: warns and skips
  • .lintrunner.toml missing: warns and skips
  • First init (no hash stored): runs lintrunner init, stores hash
  • Second commit (toml unchanged): skips init
  • .lintrunner.toml modified: re-runs init
  • lintrunner init fails: blocks commit
  • First commit (no HEAD^): runs without error
  • Clean file: lint passes, commit succeeds
  • Lint violation: lint fails, commit blocked
  • sha256sum/shasum produce same hash

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Apr 3, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18689

Note: Links to docs will display an error until the docs builds have been completed.

❌ 6 New Failures, 4 Unrelated Failures

As of commit 298865a with merge base 1e9bd73 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Summary:
Run lintrunner automatically on every commit via .githooks/pre-commit.
Hooks are enabled by default through install_executorch.sh.

Test Plan:
Verified lint violations block commits and clean files pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Streamline Internal and External CI to ease qualcomm development workflow

1 participant