Skip to content

pre-commit.ci: update pre-commit hooks #628

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.12 → v0.12.2](astral-sh/ruff-pre-commit@v0.11.12...v0.12.2)
- [github.com/rbubley/mirrors-prettier: v3.5.3 → v3.6.2](rbubley/mirrors-prettier@v3.5.3...v3.6.2)
- [github.com/pre-commit/mirrors-mypy: v1.16.0 → v1.16.1](pre-commit/mirrors-mypy@v1.16.0...v1.16.1)
Comment on lines 1073 to 1080
cov_method: Callable[..., NDArray[Any]]
if method == "clip":
from glass.algorithm import cov_clip as cov_method
from glass.algorithm import cov_clip as cov_method # noqa: PLC0415
elif method == "nearest":
from glass.algorithm import cov_nearest as cov_method
from glass.algorithm import cov_nearest as cov_method # noqa: PLC0415
else:
msg = f"unknown method '{method}'" # type: ignore[unreachable]
raise ValueError(msg)
Copy link
Member

Choose a reason for hiding this comment

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

I think this needs a re-write

@ntessore
Copy link
Collaborator

ntessore commented Jul 8, 2025

Let's disable PLC0415 because there are clearly benefits to importing outside top-level for slow imports. I can do that here or in a separate PR.

@paddyroddy
Copy link
Member

Let's disable PLC0415 because there are clearly benefits to importing outside top-level for slow imports. I can do that here or in a separate PR.

I'll do it

@Saransh-cpp
Copy link
Member

Raised #629 for the failing tests 😞

hooks:
- id: ruff
Copy link
Member

Choose a reason for hiding this comment

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

Deprecated

@@ -135,6 +135,7 @@ xfail_strict = true
[tool.ruff]
fix = true
force-exclude = true
per-file-target-version = {"examples/*" = "py313"}
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's really useful! Good spot!

@paddyroddy paddyroddy self-assigned this Jul 8, 2025
Copy link
Collaborator

@ntessore ntessore left a comment

Choose a reason for hiding this comment

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

We should undo the changes around PLC0415, since we switched that one off. (I'm happy to do that, since you are off, just give me a 🚀.)

@paddyroddy
Copy link
Member

We should undo the changes around PLC0415, since we switched that one off. (I'm happy to do that, since you are off, just give me a 🚀.)

I turned it off for tests, not the main code — hesitant to do so. Besides the fitsio import, do we really want the others to stay as they are?

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.

3 participants