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

Replace flake8/flake8-docstrings with ruff #1063

Merged
merged 26 commits into from
Jan 3, 2025

Conversation

MarkZH
Copy link
Collaborator

@MarkZH MarkZH commented Dec 30, 2024

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

Flake8-docstrings is deprecated because pydocstyle
(https://github.com/pycqa/pydocstyle) is deprecated. The
checker/linter/formatter ruff is recommended in its place.

Related Issues:

N/A

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Screenshots/logs (if applicable):

N/A

Flake8-docstrings is deprecated because pydocstyle
(https://github.com/pycqa/pydocstyle) is deprecated. The
checker/linter/formatter ruff is recommended in its place.
@MarkZH
Copy link
Collaborator Author

MarkZH commented Dec 30, 2024

We'll need to check whether everything that was covered by flake8 is still covered by ruff. Rule sets are listed here.

@AttackingOrDefending
Copy link
Member

AttackingOrDefending commented Dec 31, 2024

When I linted with --select ALL I saw that it has some nice additional warnings like Q000 [*] Single quotes found but double quotes preferred, so I would suggest enabling all rules and just disabling a few if we want (like PLR0913 Too many arguments in function definition (6 > 5), BLE001 Do not catch blind exception: Exception and FBT001 Boolean-typed positional argument in function definition).

Since ruff supports all of flake8's F rules then everything should be covered.

@AttackingOrDefending
Copy link
Member

Since we replaced flake8 with ruff I think we should also remove flake8-markdown. It doesn't matter if ruff doesn't have an alternative for this as I don't think we have any python code on out markdown files.

Ruff handles flake8 errors, and there is nothing for flake8-markdown to
check.
@AttackingOrDefending AttackingOrDefending merged commit a587ae1 into lichess-bot-devs:master Jan 3, 2025
23 checks passed
@MarkZH MarkZH deleted the ruff-checks branch January 5, 2025 00:08
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