Skip to content

Activate rule for B018 for useless attribute access #87

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

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ ignore = [
"B007", # Loop control variable `result` not used within loop body
"B008", # Do not perform function call `typer.Option` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
"B018", # Found useless attribute access. Either assign it to a variable or remove it.
"C408", # Unnecessary `dict` call (rewrite as a literal)
"C414", # Unnecessary `list` call within `sorted()`
"FURB110", # Replace ternary `if` expression with `or` operator
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/sdk/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1309,10 +1309,10 @@ async def test_node_get_relationship_not_in_store(client, location_schema, locat
node = InfrahubNodeSync(client=client, schema=location_schema, data=location_data01)

with pytest.raises(NodeNotFoundError):
node.primary_tag.peer # pylint: disable=pointless-statement
_ = node.primary_tag.peer

with pytest.raises(NodeNotFoundError):
node.tags[0].peer # pylint: disable=pointless-statement
_ = node.tags[0].peer


@pytest.mark.parametrize("client_type", client_types)
Expand Down