[llvm] [openmp] [polly] GitHub Actions: Lint Python code for just for SyntaxErrors (PR #123940)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 22 16:02:11 PST 2025
boomanaiden154 wrote:
> ruff lints all files in the codebase in 1 second with no filters and no cache.
That's quite impressive, and a little bit surprising.
> In a compiled language these errors would not exist in the repo but in an interpreted language like Python, building an AST is required to find these errors. This PR chooses to do this with ruff which is written in Rust for speed.
The errors only get caught if the code gets compiled. Syntax errors in Python will get caught if the code runs. The vast majority of the Python in LLVM gets run by our premerge checks, and even more gets run post-submit. I don't think we're really lacking any significant coverage in terms of python syntax errors.
> Cloning the repo on GitHub's high performance network takes 1m 20 so it is surprising that you do not use https://pre-commit.com/ for the linting and formatting jobs because it implements the diff-only kind of processing that you mention as vital.
I fail to see how precommit hooks help here. Our infrastructure is already diff-driven for a variety of reasons and set up through GHA for integration with Github.
> I would be delighted to delete any unused files.
You need to open up separate patches per-subproject for that. It would be good to do anyways for fixing the syntax errors. Although it's quite difficult to figure out what is used and unused with a project like LLVM.
https://github.com/llvm/llvm-project/pull/123940
More information about the llvm-commits
mailing list