-
Notifications
You must be signed in to change notification settings - Fork 11
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
Switch to ruff for formatting and linting #169
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #169 +/- ##
=======================================
Coverage 72.64% 72.64%
=======================================
Files 36 36
Lines 4058 4058
=======================================
Hits 2948 2948
Misses 1110 1110 ☔ View full report in Codecov by Sentry. |
|
||
.PHONY: mypy | ||
mypy: | ||
$(PYTHON) -m mypy --show-error-codes $(PYTHON_SOURCE_DIRS) | ||
|
||
.PHONY: fmt | ||
fmt: | ||
isort $(PYTHON_SOURCE_DIRS) | ||
black $(PYTHON_SOURCE_DIRS) | ||
ruff format $(PYTHON_SOURCE_DIRS) |
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.
ruff format $(PYTHON_SOURCE_DIRS) | |
ruff check --fix $(PYTHON_SOURCE_DIRS) | |
ruff format $(PYTHON_SOURCE_DIRS) |
suggestion: Also allow auto-fixing.
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.
Added, limited to isort rules, as I don't think the fmt
target should fix other violations.
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.
That's OK, but now I'm curious as to why 😄 In my experience the ruff auto-fixers exceedingly rarely does the wrong thing.
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.
Yes, it is not about that, but rather about semantics. I think that a target that is supposed to format code should not make unrelated changes.
This LGTM, but I'm not authorized to merge in this repository. |
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.
LGTM
No description provided.