Skip to content

Conversation

@jorgepiloto
Copy link
Member

@jorgepiloto jorgepiloto commented Feb 1, 2023

Fixes #67 by implementing ruff for unifying flake8, isort, pep8-naming, and pydocstyle.

This is also a good oportunity to identify the style errors we are getting. The following command allows to filer and count these errors:

ruff . | awk '{print $2}' | sort | uniq

With current style ignores, the following ruff errors are present:

D100: Missing docstring in public module
D101: Missing docstring in public class
D102: Missing docstring in public method
D103: Missing docstring in public function
D104: Missing docstring in public package
D105: Missing docstring in magic method
D107: Missing docstring in __init__     
D205: 1 blank line required between summary line and description (fixable by ruff)
D301: Use r""" if any backslashes in a docstring
D400: First line should end with a period (fixable by ruff)
D401: First line of docstring should be in imperative mood
D402: First line should not be the function's signature
D404: First word of the docstring should not be "This"
D415: Section has no content ("{name}")
D417: Missing argument description in the docstring: {name}
E722: Do not use bare except
F403: from {name} import * used; unable to detect undefined names (see issue #18)
F405: {name} may be undefined, or defined from star imports: {sources} (see issue #18)
F821: Undefined name {name}

Filter out particular errors by running:

ruff . | grep "<ERROR NAME>"

Some of the previous issues are easy to fix while others are not.

This pull-request is related with the main issue #6.

@github-actions github-actions bot added the maintenance Generic maintenance related label Feb 1, 2023
@jorgepiloto jorgepiloto force-pushed the maint/ruff branch 4 times, most recently from 77e906c to c6584d5 Compare February 2, 2023 06:12
Copy link
Contributor

@MaxJPRey MaxJPRey left a comment

Choose a reason for hiding this comment

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

This looks great! I will use it in PyAEDT, as soon as I am done with the pyproject.toml migration.

@jorgepiloto jorgepiloto marked this pull request as ready for review October 27, 2023 05:41
@jorgepiloto jorgepiloto requested a review from a team as a code owner October 27, 2023 05:41
@jorgepiloto jorgepiloto merged commit 8850f94 into main Oct 27, 2023
@jorgepiloto jorgepiloto deleted the maint/ruff branch October 27, 2023 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Generic maintenance related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explore the usage of ruff as alternative linter to flake8 + isort + pydocstyle + more!

4 participants