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

Lint Python code with ruff #189

Merged
merged 1 commit into from
Sep 10, 2023
Merged

Lint Python code with ruff #189

merged 1 commit into from
Sep 10, 2023

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Sep 1, 2023

Ruff supports over 600 lint rules and can be used to replace Flake8 (plus dozens of plugins), isort, pydocstyle, yesqa, eradicate, pyupgrade, and autoflake, all while executing (in Rust) tens or hundreds of times faster than any individual tool.

Copy link
Owner

@goodmami goodmami left a comment

Choose a reason for hiding this comment

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

Hi @cclauss, thanks for the PR. I've heard good things about Ruff and this is mostly a welcome change. I have some comments, mostly around the configuration in pyproject.toml.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
wn/_add.py Outdated Show resolved Hide resolved
Copy link
Owner

@goodmami goodmami left a comment

Choose a reason for hiding this comment

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

I went through the Ruff rule sets to better understand what was being included. Most seemed moderately useful, but a handful were irrelevant, some partially overlapped with others, and some capture strange errors I would not likely make. So I think it makes more sense to start with a small set of rules and later add the ones that need it. Furthermore, I looked through the popular projects that Ruff advertises as using it, and all of them had small sets (~5) of rule categories, so I'd like to follow their example until I'm more familiar with the tool.

wn/_add.py Outdated Show resolved Hide resolved
wn/_add.py Outdated Show resolved Hide resolved
wn/_add.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@goodmami goodmami merged commit c325fa3 into goodmami:main Sep 10, 2023
12 checks passed
@goodmami
Copy link
Owner

@cclauss Thanks for making those changes. I don't think there's any further reason to delay this, so I've merged it. More rules could be added in the future as needed. And thanks again for taking the initiative and making the PR!

@cclauss cclauss deleted the ruff branch September 10, 2023 19:17
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