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

Use Ruff for linting and formatting #6490

Closed
wants to merge 9 commits into from
Closed

Conversation

breakid
Copy link

@breakid breakid commented Nov 16, 2024

Ruff is "[a]n extremely fast Python linter and code formatter, written in Rust." It supports, and consolidates, checks from a wide variety of other tools (e.g., flake8, isort, pydocstyle, pylint, etc.).

  • Added Ruff config to pyproject.toml
  • Fixed linting errors

Opinionated Changes

  • Increased the required Python version 3.9, since everything older is past end-of-life
    • Ruff did not support Python 3.4
  • Increased the max line-length to 100 characters to improve readability on modern monitors
    • I typically use 120 characters but choose a more moderate 100 as a compromise
    • This can be easily reverted, if desired

@breakid breakid marked this pull request as draft November 17, 2024 00:58
@breakid
Copy link
Author

breakid commented Nov 17, 2024

I can't figure out why the pypy tests are failing. What's even weirder is that they fail on the master branch for me, despite clearly passing in the last pull request merged.

@mikf
Copy link
Owner

mikf commented Nov 20, 2024

Thanks, but I have no interest in using Ruff or anything other than flake8 for linting, especially if it would mean removing support for Python 3.8 and lower as well as reformatting 500+ files and having to re-setup all my (local) tool chains.

Maybe in the far future, but for now flake8 is more than good enough.

I can't figure out why the pypy tests are failing. What's even weirder is that they fail on the master branch for me, despite clearly passing in the last pull request merged.

This error was unrelated to your changes an got "fixed" in bced143

@breakid
Copy link
Author

breakid commented Nov 21, 2024

Fair enough. I have the Ruff extension installed in my IDE, and it automatically started making changes, so I figured I'd make the suggestion.

Thank you for letting me know about the pypy issue.

@breakid breakid closed this Nov 21, 2024
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