Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Speedup pre-commit static check #91417

Merged

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented May 1, 2024

The current implementation of pre-commit will always attempt to check every single file in the repo, which is relatively slow for most of the included checks and absurdly slow (multiple minutes) for dotnet-format. This PR rectifies this by overriding the default extra_args in two ways: specifying the actual changed files we currently store in env.CHANGED_FILES & making the output verbose for logging convenience. This speeds up the entire static check action to under a minute!

@Repiteo Repiteo requested a review from a team as a code owner May 1, 2024 15:14
@AThousandShips AThousandShips added this to the 4.x milestone May 1, 2024
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense for now, but actually the env.CHANGED_FILES system is pretty hacky and something I'd be happy to remove eventually.

It seems to me like pre-commit has features to properly assess whether the actual files modified locally should be a match for each check, so we may want to look into this to optimize further, especially for running the checks locally.

@akien-mga akien-mga modified the milestones: 4.x, 4.3 May 1, 2024
@akien-mga akien-mga changed the title Buildsystem: Speedup pre-commit static check CI: Speedup pre-commit static check May 1, 2024
@akien-mga akien-mga merged commit 92e726d into godotengine:master May 1, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@Repiteo Repiteo deleted the buildsystem/speedup-static-check branch May 1, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants