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

Add ruff linting support #2654

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Conversation

correctmost
Copy link
Contributor

PR Description:

This PR adds ruff to the CI checks and pre-commit checks.

Only linting is enabled, no auto-formatting is performed. (#1681 is related work.)

More rules can be enabled in the future (after the relevant code is fixed):

Tests and Checks

  • I have tested the code!

@correctmost correctmost requested a review from Torxed as a code owner August 28, 2024 17:16
@@ -287,7 +287,7 @@ def error(

def warn(
*msgs: str,
level: int = logging.WARN,
level: int = logging.WARNING,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a fix for this issue: https://docs.astral.sh/ruff/rules/logging-warn/

@svartkanin
Copy link
Collaborator

@correctmost is the idea to replace flake8 eventually?

I'm okay with a better (faster) linter and it's a drop in replacement for flake8 as well. I'll let @Torxed have the final say on it :)

@correctmost
Copy link
Contributor Author

Good question :). My main goal was to add some infrastructure to help catch as many bugs as possible before merging.

I think ruff, mypy, and Pylint are the most important tools to get working in the short term. Once the codebase is compliant with those tools, I think the following replacements can happen:

Pyright also seems useful, but I've had less success integrating it into existing codebases.

@Torxed
Copy link
Member

Torxed commented Aug 29, 2024

Since it's not being destructive and only linting, I say lets go for it :)

@Torxed Torxed merged commit 8391668 into archlinux:master Aug 29, 2024
7 checks passed
@correctmost correctmost deleted the cm/ruff-support branch August 29, 2024 12:07
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