Skip to content

Conversation

@harshil21
Copy link
Member

@harshil21 harshil21 commented Mar 12, 2023

Makes ruff use more checkers, so we can now remove pyupgrade and isort from pre-commit hooks.

New checkers used:

  • isort

  • pylint

  • pyupgrade

  • ruff's checkers

  • flake8-use-pathlib

  • flake8-bugbear

  • flake8-comprehensions

  • flake8-pie

  • flake8-pytest-style

  • flake8-return

  • flake8-simplify

  • flake8-raise

  • flake8-logging-format

  • flake8-implicit-str-concat

  • TODO: Remove the ruff noqa line from test_official after api 6.6 is merged

@harshil21 harshil21 added the 🛠 code-quality change type: code-quality label Mar 12, 2023
@harshil21 harshil21 added this to the v20.2 milestone Mar 12, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hey! Looks like you edited the (optional) requirements or the pre-commit hooks. I'm just a friendly reminder to keep the additional dependencies for the hooks in sync with the requirements :)

Copy link
Member

@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Regarding the several changed comparisons: I guess that ruff doesn't like hardcoded values there. However, I see no value of something like

const = 5
if something == const:
    ...

especially if the comparison is part of a function. The definition of const should at the very least be moved outside of the function definition to avoid defining it on every run.

@harshil21
Copy link
Member Author

Thanks for the PR!

Regarding the several changed comparisons: I guess that ruff doesn't like hardcoded values there. However, I see no value of something like

const = 5
if something == const:
    ...

especially if the comparison is part of a function. The definition of const should at the very least be moved outside of the function definition to avoid defining it on every run.

I don't really like it either.. do you want to ignore it?

Copy link
Member

@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

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

Soooo many changes in the tests 😮

@Bibo-Joshi Bibo-Joshi removed this from the v20.2 milestone Mar 24, 2023
@Bibo-Joshi Bibo-Joshi merged commit 9997a9f into master Mar 25, 2023
@Bibo-Joshi Bibo-Joshi deleted the extend-ruff branch March 25, 2023 18:18
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🛠 code-quality change type: code-quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants