Skip to content

Replace legacy hooks with pre-commit Python tool#1504

Merged
dsnopek merged 1 commit into
godotengine:masterfrom
Repiteo:pre-commit-hooks
Jun 25, 2024
Merged

Replace legacy hooks with pre-commit Python tool#1504
dsnopek merged 1 commit into
godotengine:masterfrom
Repiteo:pre-commit-hooks

Conversation

@Repiteo

@Repiteo Repiteo commented Jun 24, 2024

Copy link
Copy Markdown
Contributor

Overhauls the hook system to utilize the main repo's pre-commit hook logic. Migrated relevant files and settings over as needed, as well as applying any detected changes. In particular, this changes the python formatting system from black to ruff & ensures all the tools used in the checks are now easily accessible via pyproject.toml. The misc/hooks folder was removed entirely, with all relevant logic being handled in misc/scripts or .pre-commit-config.yaml.

@Repiteo Repiteo added enhancement This is an enhancement on the current functionality topic:buildsystem Related to the buildsystem or CI setup labels Jun 24, 2024
@Repiteo Repiteo added this to the 4.x milestone Jun 24, 2024
@Repiteo
Repiteo requested review from a team as code owners June 24, 2024 20:38
@dsnopek

dsnopek commented Jun 25, 2024

Copy link
Copy Markdown
Collaborator

Thanks, this looks really great!

Seems to work perfectly in my testing. Skimming the changes, they seem to match all the equivalents in the Godot repo. And all the code style fixes seem good to me too.

@dsnopek
dsnopek merged commit 7d7799b into godotengine:master Jun 25, 2024
@Repiteo
Repiteo deleted the pre-commit-hooks branch June 25, 2024 16:42
@dsnopek

dsnopek commented Jul 17, 2024

Copy link
Copy Markdown
Collaborator

Cherry-picked for 4.2 in PR #1527

@dsnopek

dsnopek commented Jul 17, 2024

Copy link
Copy Markdown
Collaborator

Cherry-picked for 4.1 in PR #1529

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Jul 22, 2024
@bgie

bgie commented Jan 20, 2025

Copy link
Copy Markdown
Contributor

The main README.md does not appear to have been updated yet.

It still mentions:
Please install clang-format and copy the files in misc/hooks into .git/hooks so formatting is done before your changes are submitted.

There is a short section about the new pre-commit in the main godot engine documentation

I suppose linking to this would be an acceptable solution?

@dsnopek

dsnopek commented Jan 20, 2025

Copy link
Copy Markdown
Collaborator

There is a short section about the new pre-commit in the main godot engine documentation

I suppose linking to this would be an acceptable solution?

Yes, I think that would be fine!

Feel free to make a PR to update the README :-)

UPDATE: Oh, nevermind, you already did! #1686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This is an enhancement on the current functionality topic:buildsystem Related to the buildsystem or CI setup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants