Bump ruff from 0.2.2 to 0.3.2 in /requirements (#21994)

* Bump ruff from 0.2.2 to 0.3.2 in /requirements

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.2 to 0.3.2.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.2.2...v0.3.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* ruff formatting changes in 0.3.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Williamson <awilliamson@mozilla.com>
This commit is contained in:
dependabot[bot] 2024-03-18 11:28:28 +00:00 коммит произвёл GitHub
Родитель ba5bdfca93
Коммит 8a99ae753e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
21 изменённых файлов: 69 добавлений и 59 удалений

Просмотреть файл

@ -4,6 +4,7 @@ pytest hooks and fixtures used for our unittests.
Please note that there should not be any Django/Olympia related imports
on module-level, they should instead be added to hooks or fixtures directly.
"""
import os
import uuid

Просмотреть файл

@ -240,24 +240,24 @@ mypy-extensions==1.0.0 \
tomli==2.0.1 \
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
ruff==0.2.2 \
--hash=sha256:0a9efb032855ffb3c21f6405751d5e147b0c6b631e3ca3f6b20f917572b97eb6 \
--hash=sha256:0c126da55c38dd917621552ab430213bdb3273bb10ddb67bc4b761989210eb6e \
--hash=sha256:1695700d1e25a99d28f7a1636d85bafcc5030bba9d0578c0781ba1790dbcf51c \
--hash=sha256:1ec49be4fe6ddac0503833f3ed8930528e26d1e60ad35c2446da372d16651ce9 \
--hash=sha256:3b65494f7e4bed2e74110dac1f0d17dc8e1f42faaa784e7c58a98e335ec83d7e \
--hash=sha256:5e1439c8f407e4f356470e54cdecdca1bd5439a0673792dbe34a2b0a551a2fe3 \
--hash=sha256:5e22676a5b875bd72acd3d11d5fa9075d3a5f53b877fe7b4793e4673499318ba \
--hash=sha256:6a61ea0ff048e06de273b2e45bd72629f470f5da8f71daf09fe481278b175001 \
--hash=sha256:940de32dc8853eba0f67f7198b3e79bc6ba95c2edbfdfac2144c8235114d6726 \
--hash=sha256:b0c232af3d0bd8f521806223723456ffebf8e323bd1e4e82b0befb20ba18388e \
--hash=sha256:c9d15fc41e6054bfc7200478720570078f0b41c9ae4f010bcc16bd6f4d1aacdd \
--hash=sha256:cc9a91ae137d687f43a44c900e5d95e9617cb37d4c989e462980ba27039d239d \
--hash=sha256:d450b7fbff85913f866a5384d8912710936e2b96da74541c82c1b458472ddb39 \
--hash=sha256:d920499b576f6c68295bc04e7b17b6544d9d05f196bb3aac4358792ef6f34325 \
--hash=sha256:e62ed7f36b3068a30ba39193a14274cd706bc486fad521276458022f7bccb31d \
--hash=sha256:ecd46e3106850a5c26aee114e562c329f9a1fbe9e4821b008c4404f64ff9ce73 \
--hash=sha256:f63d96494eeec2fc70d909393bcd76c69f35334cdbd9e20d089fb3f0640216ca
ruff==0.3.2 \
--hash=sha256:0ac06a3759c3ab9ef86bbeca665d31ad3aa9a4b1c17684aadb7e61c10baa0df4 \
--hash=sha256:0c1bdd9920cab5707c26c8b3bf33a064a4ca7842d91a99ec0634fec68f9f4037 \
--hash=sha256:1231eacd4510f73222940727ac927bc5d07667a86b0cbe822024dd00343e77e9 \
--hash=sha256:2c6d613b19e9a8021be2ee1d0e27710208d1603b56f47203d0abbde906929a9b \
--hash=sha256:5f65103b1d76e0d600cabd577b04179ff592064eaa451a70a81085930e907d0b \
--hash=sha256:77f2612752e25f730da7421ca5e3147b213dca4f9a0f7e0b534e9562c5441f01 \
--hash=sha256:967978ac2d4506255e2f52afe70dda023fc602b283e97685c8447d036863a302 \
--hash=sha256:9966b964b2dd1107797be9ca7195002b874424d1d5472097701ae8f43eadef5d \
--hash=sha256:9bd640a8f7dd07a0b6901fcebccedadeb1a705a50350fb86b4003b805c81385a \
--hash=sha256:b74c3de9103bd35df2bb05d8b2899bf2dbe4efda6474ea9681280648ec4d237d \
--hash=sha256:b83d17ff166aa0659d1e1deaf9f2f14cbe387293a906de09bc4860717eb2e2da \
--hash=sha256:bb875c6cc87b3703aeda85f01c9aebdce3d217aeaca3c2e52e38077383f7268a \
--hash=sha256:be75e468a6a86426430373d81c041b7605137a28f7014a72d2fc749e47f572aa \
--hash=sha256:c8439338a6303585d27b66b4626cbde89bb3e50fa3cae86ce52c1db7449330a7 \
--hash=sha256:de8b480d8379620cbb5ea466a9e53bb467d2fb07c7eca54a4aa8576483c35d36 \
--hash=sha256:f380be9fc15a99765c9cf316b40b9da1f6ad2ab9639e551703e581a5e6da6745 \
--hash=sha256:fa78ec9418eb1ca3db392811df3376b46471ae93792a81af2d1cbb0e5dcb5142
typing_extensions==4.10.0 \
--hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \
--hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb

Просмотреть файл

@ -5,6 +5,7 @@ If you need to overload settings, please do so in a local_settings.py file (it
won't be tracked in git).
"""
import os
from urllib.parse import urlparse

Просмотреть файл

@ -692,12 +692,12 @@ class TestCinderJob(TestCase):
for existing_action in DECISION_ACTIONS.values
}
for action in DECISION_ACTIONS.REMOVING.values:
action_existing_to_class[
(DECISION_ACTIONS.AMO_APPROVE, action)
] = CinderActionTargetAppealApprove
action_existing_to_class[
(action, action)
] = CinderActionTargetAppealRemovalAffirmation
action_existing_to_class[(DECISION_ACTIONS.AMO_APPROVE, action)] = (
CinderActionTargetAppealApprove
)
action_existing_to_class[(action, action)] = (
CinderActionTargetAppealRemovalAffirmation
)
for (
new_action,
@ -710,9 +710,9 @@ class TestCinderJob(TestCase):
# and repeat for the override edge case
for action in DECISION_ACTIONS.REMOVING.values:
action_existing_to_class[
(DECISION_ACTIONS.AMO_APPROVE, action)
] = CinderActionOverrideApprove
action_existing_to_class[(DECISION_ACTIONS.AMO_APPROVE, action)] = (
CinderActionOverrideApprove
)
action_existing_to_class[(action, action)] = CinderActionNotImplemented
for (

Просмотреть файл

@ -1488,19 +1488,19 @@ class TestAccountViewSetUpdate(TestCase):
'display_name': ['Ensure this field has no more than 50 characters.']
}
response = self.patch(data={'display_name': '\x7F\u20DF'})
response = self.patch(data={'display_name': '\x7f\u20df'})
assert response.status_code == 400
assert json.loads(force_str(response.content)) == {
'display_name': ['Must contain at least one printable character.']
}
response = self.patch(data={'display_name': '\u2800\u3164\u115F\u1160\uFFA0'})
response = self.patch(data={'display_name': '\u2800\u3164\u115f\u1160\uffa0'})
assert response.status_code == 400
assert json.loads(force_str(response.content)) == {
'display_name': ['Must contain at least one printable character.']
}
response = self.patch(data={'display_name': 'a\x7F'})
response = self.patch(data={'display_name': 'a\x7f'})
assert response.status_code == 200
response = self.patch(data={'display_name': 'a' * 50})

Просмотреть файл

@ -348,9 +348,9 @@ def notify_about_activity_log(
add_prefix=False,
)
)
staff_cc_context_dict[
'email_reason'
] = 'you are member of the activity email cc group'
staff_cc_context_dict['email_reason'] = (
'you are member of the activity email cc group'
)
send_activity_mail(
reviewer_subject,
template.render(staff_cc_context_dict),

Просмотреть файл

@ -32,9 +32,9 @@ class AddonIndexer:
"""
for field_name in field_names:
# _translations is the suffix in TranslationSerializer.
mapping['properties'][
'%s_translations' % field_name
] = cls.get_translations_definition()
mapping['properties']['%s_translations' % field_name] = (
cls.get_translations_definition()
)
@classmethod
def get_translations_definition(cls):

Просмотреть файл

@ -1,6 +1,7 @@
"""
Miscellaneous helpers that make Django compatible with AMO.
"""
from olympia.constants import permissions # noqa
from olympia.constants import promoted # noqa
from olympia.constants.activity import ( # noqa

Просмотреть файл

@ -625,9 +625,9 @@ class TestCase(PatchMixin, InitializeSessionMixin, test.TestCase):
for throttle_class in view_class.throttle_classes:
throttle = throttle_class()
# generate a different value each time, emulating hitting different CDNs
fake_request.META[
'HTTP_X_FORWARDED_FOR'
] = f'{remote_addr}, {get_random_ip()}'
fake_request.META['HTTP_X_FORWARDED_FOR'] = (
f'{remote_addr}, {get_random_ip()}'
)
# allow_request() fetches the history, triggers a success/failure
# and if it's a success it will add the request to the history and
# set that in the cache. If it failed, we force a success anyway

Просмотреть файл

@ -1,4 +1,5 @@
"""Testing the pytest fixtures themselves which are declared in conftest.py."""
import pytest
import requests
import responses

Просмотреть файл

@ -1,4 +1,5 @@
"""Check all our redirects from remora to zamboni."""
from olympia.amo.tests import TestCase

Просмотреть файл

@ -121,9 +121,9 @@ def test_sentry_data_scrubbing():
# Same for expected_frame_data.
expected_frame_data['vars']['email'] = '*** redacted ***'
expected_frame_data['vars']['some_dict']['email'] = '*** redacted ***'
expected_frame_data['vars']['some_dict']['second_level'][1][
'email'
] = '*** redacted ***'
expected_frame_data['vars']['some_dict']['second_level'][1]['email'] = (
'*** redacted ***'
)
assert (
expected_frame_data
== event['exception']['values'][0]['stacktrace']['frames'][3]
@ -133,9 +133,9 @@ def test_sentry_data_scrubbing():
assert len(event['breadcrumbs']['values']) == 8
# We redacted the rest
expected_breadcrumb_data['data'][
'url'
] = 'https://reputationservice.example.com/...redacted...'
expected_breadcrumb_data['data']['url'] = (
'https://reputationservice.example.com/...redacted...'
)
assert expected_breadcrumb_data == event['breadcrumbs']['values'][5]
# Sensitive stuff that should have been redacted.

Просмотреть файл

@ -28,9 +28,9 @@ class OneOrMorePrintableCharacterValidator:
special_blank_characters = (
'\u2800', # U+2800 BRAILLE PATTERN BLANK
'\u3164', # U+3164 HANGUL FILLER
'\u115F', # U+115F HANGUL CHOSEONG FILLER
'\u115f', # U+115F HANGUL CHOSEONG FILLER
'\u1160', # U+1160 HANGUL JUNGSEONG FILLER
'\uFFA0', # U+FFA0 HALFWIDTH HANGUL FILLER
'\uffa0', # U+FFA0 HALFWIDTH HANGUL FILLER
)
def __call__(self, value):

Просмотреть файл

@ -12,6 +12,7 @@ AMO uses JWT tokens in a different way. Notes:
See https://github.com/GetBlimp/django-rest-framework-jwt/ for more info.
"""
from calendar import timegm
from datetime import datetime

Просмотреть файл

@ -291,7 +291,7 @@ class TestBlocklistSubmissionAdmin(TestCase):
# not a checkbox because in a submission, green circle because not blocked
assert doc(f'li[data-version-id="{ver_add_subm.id}"]').text() == (
f'\U0001F7E2{ver_add_subm.version} [Edit Submission]'
f'\U0001f7e2{ver_add_subm.version} [Edit Submission]'
)
assert doc(f'li[data-version-id="{ver_add_subm.id}"] span').attr('title') == (
'Not blocked'
@ -305,7 +305,7 @@ class TestBlocklistSubmissionAdmin(TestCase):
# not a checkbox because blocked already and this is an add action
assert doc(f'li[data-version-id="{ver_block.id}"]').text() == (
f'\U0001F6D1{ver_block.version}'
f'\U0001f6d1{ver_block.version}'
)
assert doc(f'li[data-version-id="{ver_block.id}"] span').attr('title') == (
'Blocked'
@ -2260,25 +2260,25 @@ class TestBlockAdminDelete(TestCase):
# not a checkbox because in a submission, green circle because not blocked
assert doc(f'li[data-version-id="{ver_add_subm.id}"]').text() == (
f'\U0001F7E2{ver_add_subm.version} [Edit Submission]'
f'\U0001f7e2{ver_add_subm.version} [Edit Submission]'
)
assert doc(f'li[data-version-id="{ver_add_subm.id}"] span').attr('title') == (
'Not blocked'
)
# not a checkbox because in a submission, red hexagon because not blocked
assert doc(f'li[data-version-id="{ver_del_subm.id}"]').text() == (
f'\U0001F6D1{ver_del_subm.version} [Edit Submission]'
f'\U0001f6d1{ver_del_subm.version} [Edit Submission]'
)
assert doc(f'li[data-version-id="{ver_del_subm.id}"] span').attr('title') == (
'Blocked'
)
# not a checkbox because not blocked, and this is a delete action
assert doc(f'li[data-version-id="{ver.id}"]').text() == (
f'\U0001F7E2{ver.version}'
f'\U0001f7e2{ver.version}'
)
# not a checkbox because not blocked, and this is a delete action
assert doc(f'li[data-version-id="{ver_deleted.id}"]').text() == (
f'\U0001F7E2{ver_deleted.version}'
f'\U0001f7e2{ver_deleted.version}'
)
submission_link = doc(f'li[data-version-id="{ver_add_subm.id}"] a')

Просмотреть файл

@ -1251,9 +1251,9 @@ class CombinedNameSummaryCleanMixin:
name_length = len(name_default)
if locale in summary_values:
max_summary_length = self.MAX_LENGTH - name_length
self.cleaned_data.setdefault('summary', {})[
locale
] = summary_values[locale][:max_summary_length]
self.cleaned_data.setdefault('summary', {})[locale] = (
summary_values[locale][:max_summary_length]
)
return self.cleaned_data

Просмотреть файл

@ -1,4 +1,5 @@
"""Tests for ``devhub.views.ownership`` and ``devhub.views.invitation``."""
from django.conf import settings
from django.core import mail
from django.urls import reverse

Просмотреть файл

@ -20,6 +20,7 @@ wrapped around each callback in the urlconf as if you had @decorator above the
function.
"""
try:
from django.urls import URLPattern, URLResolver
except ImportError:

Просмотреть файл

@ -3,6 +3,7 @@
For different add-on and file statuses, test reviewing them, and make sure then
end up in the correct state.
"""
from unittest import mock
import pytest

Просмотреть файл

@ -4,6 +4,7 @@ Management utility to create superusers.
Inspired by django.contrib.auth.management.commands.createsuperuser.
(http://bit.ly/2cTgsNV)
"""
import json
from datetime import datetime

Просмотреть файл

@ -109,9 +109,9 @@ class Updater:
},
}
if version.file.strict_compatibility:
update['applications']['gecko'][
'strict_max_version'
] = version.max_compatible_version
update['applications']['gecko']['strict_max_version'] = (
version.max_compatible_version
)
if version.file.hash:
update['update_hash'] = version.file.hash
if version.release_notes_id: