Skip to content
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

task: remove deprecated Ruff checks #4020

Closed
lykinsbd opened this issue Aug 6, 2024 · 3 comments
Closed

task: remove deprecated Ruff checks #4020

lykinsbd opened this issue Aug 6, 2024 · 3 comments
Assignees
Labels
type/task Body of work related to an epic

Comments

@lykinsbd
Copy link
Contributor

lykinsbd commented Aug 6, 2024

Component

Not Sure

Task Description

JSON Schema validation of the two pyproject.toml files in Infrahub fails with the following error:

{"preview":true,"task-tags":["FIXME","TODO","XXX"],"select":["ASYNC","B","C4","C90","DJ","DTZ","E","EXE","F","I","ICN","INP","N","PIE","PL","PTH","PYI","Q","RET","S","TCH","TRIO","T10","UP","W","YTT"],"ignore":["ASYNC101","B007","B008","B009","B010","B904","C403","C409","C414","N801","N802","N805","N806","N812","PLC0415","PLC2701","PLR0904","PLR0912","PLR0913","PLR0914","PLR0915","PLR0916","PLR0917","PLR1702","PLR2004","PLR6201","PLR6301","PLW0603","PLW1508","PLW3201","PTH100","PTH102","PTH103","PTH107","PTH108","PTH109","PTH110","PTH112","PTH113","PTH117","PTH118","RET503","RET504","S101","S105","S108","S202","S311","S701","UP007","UP008","UP012","UP018","UP031","UP034"],"isort":{"known-first-party":["infrahub"]},"pycodestyle":{"max-line-length":150},"mccabe":{"max-complexity":33},"per-file-ignores":{"backend/infrahub/git/repository.py":["TCH003"],"backend/tests/**.py":["S101","S105","S106"],"models/infrastructure_edge.py":["S106","C901","E501"]}} is not valid under any of the given schemas
<snip> is not valid under any of the given schemas

Upon closer inspection, this is correct, and the configuration as stands is not valid:

https://www.jsonschemavalidator.net/s/JS9mMhoM

Found 2 error(s)
Message: Value "TRIO" is not defined in enum.
Schema path: https://json.schemastore.org/ruff.json#/definitions/RuleSelector/enum
Message: Value "ASYNC101" is not defined in enum.
Schema path: https://json.schemastore.org/ruff.json#/definitions/RuleSelector/enum

There are two problems:

  1. The TRIO checks have been deprecated and moved/renamed to ASYNC
  2. The ASYNC101 check has been deprecated and split into five other checks:
    1. ASYNC220
    2. ASYNC221
    3. ASYNC222
    4. ASYNC230
    5. ASYNC251

See: astral-sh/ruff#10416

Two fixes needed:

  1. tool.ruff.lint.select of TRIO can be removed, as it is covered by ASYNC
  2. tool.ruff.lint.ignore of ASYNC101 can be removed and replaced by the 5 listed checks above
@lykinsbd lykinsbd added the type/task Body of work related to an epic label Aug 6, 2024
@lykinsbd lykinsbd self-assigned this Aug 6, 2024
@lykinsbd lykinsbd added the state/backlog This issue is part of the backlog label Aug 6, 2024
@lykinsbd
Copy link
Contributor Author

lykinsbd commented Aug 6, 2024

This looks to be already resolved in Develop; I was seeing it in Stable.

@ogenstad
Copy link
Contributor

ogenstad commented Nov 6, 2024

@lykinsbd, we can close this now right?

@lykinsbd
Copy link
Contributor Author

lykinsbd commented Nov 6, 2024

Yes, I will close it now, thank you!

@lykinsbd lykinsbd closed this as completed Nov 6, 2024
@exalate-issue-sync exalate-issue-sync bot removed the state/backlog This issue is part of the backlog label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/task Body of work related to an epic
Projects
None yet
Development

No branches or pull requests

2 participants