-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[CHIA-1732] Add Ruff specific linting rules #18845
base: main
Are you sure you want to change the base?
Conversation
8f50032
to
53803e3
Compare
@dataclass | ||
class FakeContext: | ||
obj: dict[Any, Any] = {} | ||
|
||
def __init__(self, obj: dict[Any, Any]): | ||
self.obj = obj | ||
obj: dict[Any, Any] = field(default_factory=dict) |
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 didn't automatically make this fix, this was my response to a warning about the mutable default
@@ -245,7 +246,7 @@ class TestCheckTimeLocks: | |||
coinbase=False, | |||
timestamp=COIN_TIMESTAMP, | |||
) | |||
REMOVALS: dict[bytes32, CoinRecord] = {TEST_COIN.name(): COIN_RECORD} | |||
REMOVALS: dict[bytes32, CoinRecord] = dataclasses.field(default_factory=lambda: {TEST_COIN.name(): COIN_RECORD}) # type: ignore[name-defined] # noqa: F821 |
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.
Again, this is me addressing a concern about the mutable default. The linters still don't like it because they don't recognize COIN_RECORD
as a valid variable, but it definitely passes the tests 🤷
@@ -142,5 +142,6 @@ requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"] | |||
build-backend = "poetry_dynamic_versioning.backend" | |||
|
|||
[project] | |||
name = "chia-blockchain" |
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 sure of any ripple effects of this, might be another conflict with poetry like the version.
|
No description provided.