Skip to content

fix(repro --lint): mirror CI lint, no clang-tidy --all-files by default#219

Merged
wdvr merged 1 commit into
mainfrom
fix/repro-lint-ci-parity
Jun 22, 2026
Merged

fix(repro --lint): mirror CI lint, no clang-tidy --all-files by default#219
wdvr merged 1 commit into
mainfrom
fix/repro-lint-ci-parity

Conversation

@wdvr

@wdvr wdvr commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Problem

gpu-dev repro --lint (added in #218) defaulted to lintrunner --all-files. On main that fires CLANGTIDY across the whole tree — needs generated build files, spawns dozens of clang-tidy procs and pegs the box for ~hours. Looked hung; wasn't.

Fix — mirror what pytorch CI actually runs

Replicates .github/scripts/lintrunner.sh + the 3 lint jobs in lint.yml:

  • Codegen first: tools.generate_torch_version + tools.pyi.gen_pyi (so mypy/pyrefly are accurate), like CI.
  • Default = python/general linters: lintrunner --skip CLANGTIDY,CLANGTIDY_EXECUTORCH_COMPATIBILITY,CLANGFORMAT <scope>. No C++ build.
  • --clang opt-in adds the C++ linters (generate_build_files + --take CLANGTIDY,CLANGFORMAT) — CI isolates these in their own heavy job.
  • Scope mirrors CI: PR ref → its diff (--merge-base-with origin/main); main → --all-files; extra args override.

Validation

Live on a cpu-x86 box: generate_torch_version ✓, gen_pyi ✓, lintrunner init ✓, lintrunner --skip ... <file>ok No lint issues exit 0.
Unit: 1208 passed, 3 pre-existing xfails (lint tests updated + --clang coverage added).

Bumps gpu-dev → 0.7.14. CLI-only; no tofu apply.

…y default

Bare 'repro --lint' ran 'lintrunner --all-files', which on main fires
CLANGTIDY across the whole tree (needs generated build files, pegs the box
for ~hours). Now mirror pytorch CI (.github/scripts/lintrunner.sh):

- regenerate version + type stubs first (so mypy/pyrefly are accurate)
- run the python/general linters (--skip CLANGTIDY,CLANGTIDY_EXECUTORCH_COMPATIBILITY,CLANGFORMAT)
- C++ linters (CLANGTIDY/CLANGFORMAT) are a separate CI job -> opt-in via --clang
  (generates clang build files; heavy)
- scope mirrors CI: PR ref lints its diff (merge-base), main lints all files

Validated on a live cpu-x86 box: codegen + lintrunner init + lint run clean.
Bumps gpu-dev to 0.7.14.
@wdvr wdvr merged commit e7eb450 into main Jun 22, 2026
3 checks passed
@wdvr wdvr deleted the fix/repro-lint-ci-parity branch June 22, 2026 18:27
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