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

Pre-commit: Fix applying ruff to SCsub files #100870

Merged
merged 1 commit into from
Dec 28, 2024

Conversation

akien-mga
Copy link
Member

Also ignore iOS template dummy.h file for header guards check.

Update ruff to 0.8.4 while at it.

Also ignore iOS template dummy.h file for header guards check.

Update ruff to 0.8.4 while at it.
Comment on lines +57 to +61
files: (\.py|SConstruct|SCsub)$
types_or: [text]
- id: ruff-format
files: (\.py|SConstruct|SCsub)$
types_or: [text]
Copy link
Member Author

@akien-mga akien-mga Dec 28, 2024

Choose a reason for hiding this comment

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

This is needed because pre-commit decides which files to run on before handling potential explicit includes in pyproject.toml, at least for me on Linux with pre-commit 4.0.1.

And since the default types: is only known Python file types, it doesn't include the SConstruct and SCsub files.

@@ -14,7 +14,7 @@ python_version = "3.8"

[tool.ruff]
extend-exclude = ["thirdparty"]
extend-include = ["SConstruct", "SCsub"]
extend-include = ["*SConstruct", "*SCsub"]
Copy link
Member Author

@akien-mga akien-mga Dec 28, 2024

Choose a reason for hiding this comment

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

Before:

$ ruff format
106 files left unchanged.

After:

277 files left unchanged.

(We have a couple nested SConstructs too in the TextServer modules for their GDExtension based builds.)

On the other hand the thirdparty extend-exclude without globbing pattern seems to work file to exclude both

./modules/mono/thirdparty
./thirdparty

according to debug logs. No idea why it differs here.

@akien-mga akien-mga merged commit 75ce426 into godotengine:master Dec 28, 2024
20 checks passed
@akien-mga akien-mga deleted the ci-fix-ruff-format branch December 28, 2024 12:43
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.

None yet

2 participants