Skip to content

task: Activate "RET" rule for ruff #2192

Description

@ogenstad

Component

API Server / GraphQL, Git Integration, Python SDK, infrahubctl CLI

Task Description

We should activate the "RET" rule for ruff in all our pyproject.toml files, to clean up some of our code. There are a number of violations but it looks like ruff can automatically fix them.

❯ ruff check .
backend/infrahub/api/schema.py:123:5: RET503 Missing explicit `return` at the end of function able to return non-`None` value
backend/infrahub/auth.py:134:12: RET504 Unnecessary assignment to `access_token` before `return` statement
backend/infrahub/auth.py:150:12: RET504 Unnecessary assignment to `refresh_token` before `return` statement
backend/infrahub/core/attribute.py:235:16: RET504 Unnecessary assignment to `value` before `return` statement
backend/infrahub/core/node/__init__.py:258:16: RET504 Unnecessary assignment to `rm` before `return` statement
backend/infrahub/core/node/__init__.py:278:16: RET504 Unnecessary assignment to `attr` before `return` statement
backend/infrahub/core/node/base.py:82:16: RET504 Unnecessary assignment to `base_cls` before `return` statement

Metadata

Metadata

Assignees

No one assigned

    Labels

    group/backendIssue related to the backend (API Server, Git Agent)type/housekeepingMaintenance tasktype/newcomersGood for newcomerstype/taskBody of work related to an epic

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions