-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Add GitHub Actions for ruff for Python linting #5082
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question about line-length
[tool.isort] | ||
profile = "black" | ||
known_first_party = "kobo" | ||
no_lines_before = ["LOCALFOLDER"] | ||
|
||
[tool.ruff] | ||
line-length = 80 | ||
line-length = 88 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we making the line-length longer for ruff than for black?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we use an extra buffer of ~10 characters. If your line is 85 characters and you don't want to break it for 5 characters, we don't want the linter to complain about it. Moreover, that's the default configuration (see https://docs.astral.sh/ruff/configuration/)
# Same as Black.
line-length = 88
indent-width = 4
I would leave black as-is to format with 80 characters. Does not mean the dev cannot bring a line up to 88 characters after Black formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still a little confused. Why do we have black at 80 characters then?
Description
For developers interest, GitHub Actions is used to raise errors when the python code does not lint