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

Use ruff for linting #1781

Merged
merged 2 commits into from
May 22, 2023
Merged

Use ruff for linting #1781

merged 2 commits into from
May 22, 2023

Conversation

WhyNotHugo
Copy link
Contributor

Use ruff instead of flake8+isort+pyupgrade+pygrep-hooks. This change configures ruff to apply all the same rules that these tools apply.

I've omitted E501 for now since there are a few violations.

@WhyNotHugo
Copy link
Contributor Author

My intent is to enable a few extra rules, but I've purposefully limited this initial patch to apply the same rules as before.

Copy link
Member

@matthiask matthiask left a comment

Choose a reason for hiding this comment

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

Two minor points:

  • My experience is better when running ruff before black.
  • Is there a reason why you added ruff to requirements_dev.txt? I don't think it's necessary? Pruning flake8 and isort looks like the right thing to do anway, that has probably been forgotten when we switched to pre-commit.

Apart from that I'm very happy with ruff, and I agree with this

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@WhyNotHugo
Copy link
Contributor Author

My experience is better when running ruff before black.

I think that makes sense, I've inverted the order.

Is there a reason why you added ruff to requirements_dev.txt? I don't think it's necessary? Pruning flake8 and isort looks like the right thing to do anway, that has probably been forgotten when we switched to pre-commit.

It was mostly to stay in line with the existing requirements. I'll go ahead and drop it; I think it's sane to expect that developers have this installed already (or know how to install it).

@tim-schilling
Copy link
Member

It's probably worth dropping a line in the changes.rst file about this too.

@WhyNotHugo
Copy link
Contributor Author

It's probably worth dropping a line in the changes.rst file about this too.

This really doesn't have any user-facing changes, I'm not sure what to mention for this.

WhyNotHugo and others added 2 commits May 22, 2023 11:51
Use ruff instead of flake8+isort+pyupgrade+pygrep-hooks. This change
configures ruff to apply all the same rules that these tools apply.

I've omitted E501 for now since there are a few violations.
@matthiask matthiask merged commit 52ff5eb into main May 22, 2023
@matthiask matthiask deleted the ruff branch May 22, 2023 09:58
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.

4 participants