Disable ruff errors that HA core is also ignoring#298
Merged
sveinse merged 2 commits intocustom-components:masterfrom Aug 22, 2025
Merged
Disable ruff errors that HA core is also ignoring#298sveinse merged 2 commits intocustom-components:masterfrom
sveinse merged 2 commits intocustom-components:masterfrom
Conversation
Simple example from HA core that violates both these rules: https://github.com/home-assistant/core/blob/dev/homeassistant/helpers/entity_platform.py#L79
Collaborator
|
LGTM |
sveinse
reviewed
Aug 22, 2025
Comment on lines
+32
to
+36
| # definitely skipped in HA, not obvious how | ||
| "EM101", # Exception must not use a string literal, assign to variable first | ||
| "EM102", # Exception must not use an f-string literal, assign to variable first | ||
| "FBT001", # Boolean-typed positional argument in function definition | ||
| "FBT002", # Boolean default positional argument in function definition |
Collaborator
There was a problem hiding this comment.
HA is not only doing exclusion of rules, but also inclusion (selection). This means that there might be rules that aren't selected https://github.com/sveinse/ha-core/blob/facf217b995982ff5c504bd59d419a59c31ee068/pyproject.toml#L645
Contributor
Author
There was a problem hiding this comment.
It also looks like there's some separate rules for pylint as well. Not sure how everything is set up on the HA side, but I'm thinking we focus on fixing/excluding the errors we currently have until we can turn off --exit-zero, and then we can start considering adding more rules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Simple example from HA core that violates both of the boolean rules: https://github.com/home-assistant/core/blob/dev/homeassistant/helpers/entity_platform.py#L79