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

[ruff] Fix some configuration warnings, activate flake8-pie, flake8-pyi, and pydocstyle #9593

Merged
merged 6 commits into from May 4, 2024

Conversation

Pierre-Sassoulas
Copy link
Member

Type of Changes

Type
βœ“ πŸ› Bug fix
βœ“ πŸ”¨ Refactoring

Description

While working on another MR, I realized that there was a warning only seen when ruff fail for another reason.
ruffwarning

Took the opportunity to add some useful ruff checks and fix the existing issues. It feels like pydocstringformatter is outclassed by the rust pydocstyle included in ruff, we could stop maintaining it and remove the pre-commit hook what do you think @DanielNoord ?

@Pierre-Sassoulas Pierre-Sassoulas added Maintenance Discussion or action around maintaining pylint or the dev workflow Skip news πŸ”‡ This change does not require a changelog entry labels May 3, 2024
Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 95.81%. Comparing base (3c8be8e) to head (fc669f7).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9593   +/-   ##
=======================================
  Coverage   95.81%   95.81%           
=======================================
  Files         173      173           
  Lines       18825    18825           
=======================================
  Hits        18038    18038           
  Misses        787      787           
Files Coverage Ξ”
pylint/checkers/base/comparison_checker.py 100.00% <ΓΈ> (ΓΈ)
pylint/checkers/base/name_checker/checker.py 98.62% <ΓΈ> (ΓΈ)
pylint/checkers/base_checker.py 95.04% <100.00%> (ΓΈ)
pylint/checkers/classes/class_checker.py 93.38% <ΓΈ> (ΓΈ)
pylint/checkers/deprecated.py 99.05% <ΓΈ> (ΓΈ)
pylint/checkers/design_analysis.py 98.88% <ΓΈ> (ΓΈ)
pylint/checkers/imports.py 94.45% <ΓΈ> (ΓΈ)
pylint/checkers/non_ascii_names.py 100.00% <ΓΈ> (ΓΈ)
...int/checkers/refactoring/recommendation_checker.py 96.53% <ΓΈ> (ΓΈ)
pylint/checkers/refactoring/refactoring_checker.py 98.26% <ΓΈ> (ΓΈ)
... and 13 more

Copy link
Contributor

github-actions bot commented May 3, 2024

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit fc669f7

@@ -11,8 +11,8 @@


class MyRawChecker(BaseRawFileChecker):
"""Check for line continuations with '\' instead of using triple
quoted string or parenthesis
r"""Check for line continuations with '\' instead of using triple
Copy link
Member

Choose a reason for hiding this comment

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

Ironic update to use raw docstring in the MyRawChecker class πŸ˜„

Copy link
Member Author

Choose a reason for hiding this comment

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

Did you know it was twice voted "most likely place to see dangerous raw characters in the doc" ?

Copy link
Member

Choose a reason for hiding this comment

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

No :) what is that (doc)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just joking πŸ˜„ The doc would be the docstring in the raw checker where you explain about raw string and why you need them sometime.

@Pierre-Sassoulas Pierre-Sassoulas merged commit df5533f into pylint-dev:main May 4, 2024
48 checks passed
@Pierre-Sassoulas Pierre-Sassoulas deleted the ruff-fix-warning branch May 4, 2024 19:56
@DanielNoord
Copy link
Collaborator

I think I'd like to keep pydocstringformatter around, but if you think we should remove it from pylint go ahead of course!

From my personal perspective development on ruff has slowed down and some very important features are not being worked on (see astral-sh/ruff#3711). As long as the tool works and has minimal maintainers impact I think it serves a purpose.

@Pierre-Sassoulas
Copy link
Member Author

Pierre-Sassoulas commented May 6, 2024

Interesting that the message control from pylint is quoted as an exemple, thanks for linking this issue. Even ruff have long lived issue, troubling πŸ˜„Astral have 4/5 paid devs full time on ruff, it's probably because they chose to work on other things like uv that this issue is stuck. (Well so not 4/5 devs full time on ruff specifically). And also message control like in pylint is not easy to do.

I don't want to remove pydocstringformatter, but it seems to me the place to contribute big things is now in ruff/pydocstyle because of the hype and base speed, so wanted your opinion. (They have some autofix bugs so pydocstringformatter is better in some aspect, but also it already autofix things that pydocstringformatter did not catch).

@DanielNoord
Copy link
Collaborator

Fully agreed!

I have been thinking about rewriting pydocstringformatter in rust as a side project but never got round to it.
But indeed: probably don't make any changes to pydocstringformatter but also not remove it (for now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow Skip news πŸ”‡ This change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants