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

chore: update ruff configs #9

Merged
merged 1 commit into from
Jan 10, 2024
Merged

chore: update ruff configs #9

merged 1 commit into from
Jan 10, 2024

Conversation

AlessandroMiola
Copy link
Owner

Summary:

  • 2fe2ffa:
    • pyproject.toml: ignore line-too-long (E501) rule; (in the spirit of ruff) it is not very convenient to enforce E501 rule while using black (or ruff) as a formatter 1 as black itself will try to autoformat lines according to the line-length setting where possible; there might be situations where autoformatting is not possible and in such cases enforcing E501 will result in linting errors (unless a # noqa specification is there)

Footnotes

  1. indeed notice that, if I were to use ruff's default selection setting, E501 rule would be omitted as consequence of overlapping with the use of the formatter (see https://docs.astral.sh/ruff/tutorial/#configuration). By default, ruff enables F rules (flake8 compliant) and a subset of E rules (among which you won't find E501), namely those stylistic rules that do not overlap with the use of a formatter (like black or ruff formatter itself)
    See also https://docs.astral.sh/ruff/faq/#is-the-ruff-linter-compatible-with-black:

    Ruff is designed to be used alongside a formatter (like Ruff's own formatter, or Black) and, as such, will defer implementing stylistic rules that are obviated by automated formatting.

@AlessandroMiola AlessandroMiola merged commit 6874112 into main Jan 10, 2024
4 checks passed
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.

1 participant