-
Notifications
You must be signed in to change notification settings - Fork 0
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 PyUpgrade and import cleaning to Ruff #28
Conversation
[tool.ruff] | ||
unsafe-fixes = true | ||
lint.extend-select = [ | ||
"I", # isort |
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 also added the other ones we use in Bodo, bc I was kinda missing the clean imports :)
@@ -14,3 +14,12 @@ dev-dependencies = ["pre-commit", "pytest", "ruff==0.6.7"] | |||
[build-system] | |||
requires = ["hatchling"] | |||
build-backend = "hatchling.build" | |||
|
|||
[tool.ruff] | |||
unsafe-fixes = true |
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.
Not 100% sure about this part, but copied that from Bodo
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! Thanks you @knassre-bodo
@@ -72,7 +72,7 @@ def to_tree_form(self) -> CollectionTreeForm: | |||
) | |||
item_str: str | |||
if isinstance( | |||
self.collection_access, (SubCollection, HiddenBackReferenceCollection) | |||
self.collection_access, SubCollection | HiddenBackReferenceCollection |
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.
Srinivas opted to disable this inside Bodo because the tuple check is faster. I personally would like to disable that here as well.
"UP", # pyupgrade | ||
"C4", # flake8-comprehensions | ||
"TID", # flake8-tidy-imports | ||
] |
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.
Add trailing newline.
Updates the ruff usage in the pre-commit hooks to use the PyUpgrade reformatting rules, as well as the rules that tidy up imports.