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

Ruff 0.8.0 failures #2371

Merged
merged 7 commits into from
Nov 26, 2024
Merged

Conversation

jerabekjiri
Copy link
Contributor

@jerabekjiri jerabekjiri commented Nov 25, 2024

What is this PR doing:

No-Issue

pinned ruff to 0.7.1 in 2cd8cdf
if unpinned, it will use version 0.8.0 with and fail with errors:

> ruff check .                                                                                                                       update-docker-compose-docs [2cd8cdf4] modified untracked
warning: The following rules have been removed and ignoring them has no effect:
    - PT004
    - PT005

A004

galaxy_ng/app/tasks/settings_cache.py:10:19: A004 Import `ConnectionError` is shadowing a Python builtin
   |
 9 | from django.conf import settings
10 | from redis import ConnectionError, Redis
   |                   ^^^^^^^^^^^^^^^ A004
11 |
12 | from galaxy_ng.app.models.config import Setting
   |

UP006

galaxy_ng/tests/integration/utils/vault_loading.py:49:31: UP006 Use `dict` instead of `Dict` for type annotation
   |
47 |         return cls(mountpoint=mountpoint, client=client, settings=settings)
48 |
49 |     loaded_secrets: Dict[str, Dict[str, object]]
   |                               ^^^^ UP006
50 |
51 |     def __init__(self, mountpoint: str, client: Client, settings):
   |
   = help: Replace with `dict`

UP031

galaxy_ng/app/api/exceptions.py:36:34: UP031 Use format specifiers instead of percent format
   |
34 |         headers['WWW-Authenticate'] = exc.auth_header
35 |     if getattr(exc, 'wait', None):
36 |         headers['Retry-After'] = '%d' % exc.wait
   |                                  ^^^^ UP031
37 |
38 |     title = exc.__class__.default_detail
   |
   = help: Replace with format specifiers

UP035

galaxy_ng/tests/integration/utils/vault_loading.py:2:1: UP035 `typing.Dict` is deprecated, use `dict` instead
  |
1 | import logging
2 | from typing import Dict
  | ^^^^^^^^^^^^^^^^^^^^^^^ UP035
3 |
4 | from hvac import Client

RUF021

galaxy_ng/tests/integration/utils/legacy.py:31:28: RUF021 [*] Parenthesize `a and b` expressions when chaining `and` and `or` together, to make the precedence clear
   |
29 |     state = None
30 |     counter = 0
31 |     while state is None or state == 'RUNNING' and counter <= 500:
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUF021
32 |         counter += 1
33 |         task_resp = api_client(poll_url, method='GET')
   |
   = help: Parenthesize the `and` subexpression

RUF022

galaxy_ng/app/models/auth.py:11:11: RUF022 [*] `__all__` is not sorted
   |
 9 |   log = logging.getLogger(__name__)
10 |
11 |   __all__ = (
   |  ___________^
12 | |     "SYSTEM_SCOPE",
13 | |     "RH_PARTNER_ENGINEER_GROUP",
14 | |     "User",
15 | |     "Group",
16 | | )
   | |_^ RUF022
   |
   = help: Apply an isort-style sorting to `__all__`

@jerabekjiri jerabekjiri merged commit fc573b7 into ansible:master Nov 26, 2024
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants