Skip to content

Conversation

@afuetterer
Copy link
Contributor

What does this PR do?

This PR bumps the pre-commit hooks again and uses the new ruff-check id, silencing a deprecation warning when running the hook.

Before submitting

  • This PR fixes a typo or improves the docs (if yes, ignore all other checks!).
  • Did you read the contributor guideline?
  • Was this discussed/approved via a Github issue? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes (if applicable)?
  • Did you write any new necessary tests?

@afuetterer
Copy link
Contributor Author

@MaartenGr: A question about your workflow.

I saw the commands in the Makefile

format:
	ruff format
lint:
	ruff check --fix

Do you use these commands regularly? The version is used here is defined in pyproject.toml like this ruff~=0.4.7. This leads to 0.4.10 in a fresh install today. It is different from the version in pre-commit-config.yaml.

I never run ruff manually like this, but rely on the pre-commit hook.

But you could use pre-commit run ruff-check and pre-commit run ruff-format in the Makefile? Then you would have only one point to define the ruff version.

What do you think?

@MaartenGr
Copy link
Owner

Do you use these commands regularly? The version is used here is defined in pyproject.toml like this ruff~=0.4.7. This leads to 0.4.10 in a fresh install today. It is different from the version in pre-commit-config.yaml.

Not at all. I used to and have since switched to pre-commit (although that has been giving me problems in the past when installing in different environments).

That said, I want to switch over to Justfile over Makefile as those features are easier to use across platforms. It also might make it easier to run it

I never run ruff manually like this, but rely on the pre-commit hook.

I also have it run automatically in VSCode, which I believe is based on the plugin.

But you could use pre-commit run ruff-check and pre-commit run ruff-format in the Makefile? Then you would have only one point to define the ruff version.

That would move the dependency management of ruff in pyproject.toml to .pre-commit-config.yaml, right? That's an interesting step... Intuitively, I would say that it should belong in pyproject.toml, especially if people are getting their ruff versioning from the .venv and used automatically in VSCode, for instance.

@afuetterer
Copy link
Contributor Author

That would move the dependency management of ruff in pyproject.toml to .pre-commit-config.yaml, right?

Yes, that would be the case.

That's an interesting step... Intuitively, I would say that it should belong in pyproject.toml, especially if people are getting their ruff versioning from the .venv and used automatically in VSCode, for instance.

It is not necessary of course. If ruff would and should (?) be run manually via the ruff command (or in the IDE), it needs to be defined in pyproject.toml. I just wanted to point the difference 0.4.0 (test dependency version) vs 0.14.0 (pre-commit hook version). In "ruff years" that is a huge difference.

Your project, you decide. Bump in pyproject.toml as well?

@afuetterer
Copy link
Contributor Author

That said, I want to switch over to Justfile over Makefile as those features are easier to use across platforms. It also might make it easier to run it

Yeah, I prefer justfiles over Makefiles as well.

@MaartenGr
Copy link
Owner

Yes, let's bump in pyproject.toml.

@afuetterer
Copy link
Contributor Author

Done.

@MaartenGr MaartenGr merged commit 631068b into MaartenGr:master Nov 11, 2025
5 checks passed
@afuetterer afuetterer deleted the ruff branch December 5, 2025 08:51
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.

2 participants