Skip to content

Commit 8f139a0

Browse files
authored
Merge pull request #934 from secure-systems-lab/dependabot/pip/test-and-lint-dependencies-982229149a
Bump ruff from 0.8.6 to 0.9.1 in the test-and-lint-dependencies group
2 parents d6d6497 + 61b0725 commit 8f139a0

File tree

7 files changed

+17
-13
lines changed

7 files changed

+17
-13
lines changed

requirements-lint.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
mypy==1.14.1
2-
ruff==0.8.6
2+
ruff==0.9.1

securesystemslib/_gpg/common.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,9 @@ def _assign_certified_key_info(bundle):
385385

386386
if not is_valid:
387387
log.info(
388-
"Ignoring invalid User ID self-certificate issued "
389-
"by '{}'.".format(signature["keyid"])
388+
"Ignoring invalid User ID self-certificate issued by '{}'.".format(
389+
signature["keyid"]
390+
)
390391
)
391392
continue
392393

@@ -752,11 +753,9 @@ def parse_signature_packet(
752753
hashed_subpackets = data[ptr : ptr + hashed_octet_count]
753754
hashed_subpacket_info = gpg_util.parse_subpackets(hashed_subpackets)
754755

755-
# Check whether we were actually able to read this much hashed octets
756756
if len(hashed_subpackets) != hashed_octet_count: # pragma: no cover
757757
raise ValueError(
758-
"This signature packet seems to be corrupted."
759-
"It is missing hashed octets!"
758+
"Signature packet contains an unexpected amount of hashed octets"
760759
)
761760

762761
ptr += hashed_octet_count

securesystemslib/_gpg/eddsa.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ def get_pubkey_params(data):
7979
# See 9.2. ECC Curve OID
8080
if curve_oid != ED25519_PUBLIC_KEY_OID:
8181
raise PacketParsingError(
82-
f"bad ed25519 curve OID '{curve_oid}', "
83-
f"expected {ED25519_PUBLIC_KEY_OID}'"
82+
f"bad ed25519 curve OID '{curve_oid}', expected {ED25519_PUBLIC_KEY_OID}'"
8483
)
8584

8685
# See 13.3. EdDSA Point Format

securesystemslib/_gpg/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def parse_packet_header(data, expected_type=None): # noqa: PLR0912
192192

193193
elif length_type == 3:
194194
raise PacketParsingError(
195-
"Old length " "format packets of indeterminate length are not supported"
195+
"Old length format packets of indeterminate length are not supported"
196196
)
197197

198198
else: # pragma: no cover (unreachable)

tests/check_public_interfaces_gpg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
class TestPublicInterfacesGPG(unittest.TestCase):
4040
@classmethod
4141
def setUpClass(cls):
42-
assert (
43-
not have_gpg()
44-
), "please remove GnuPG from your environment to run this test case"
42+
assert not have_gpg(), (
43+
"please remove GnuPG from your environment to run this test case"
44+
)
4545

4646
def test_gpg_functions(self):
4747
"""Signing, key export and util functions must raise on missing gpg."""

tests/test_gpg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ def test_verify_signature_with_expired_key(self):
693693
)
694694
self.assertTrue(
695695
expected == str(ctx.exception),
696-
f"\nexpected: {expected}" "\ngot: {ctx.exception}",
696+
f"\nexpected: {expected}\ngot: {{ctx.exception}}",
697697
)
698698

699699

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ commands =
7171

7272
mypy {[testenv:lint]lint_dirs}
7373

74+
[testenv:fix]
75+
deps = {[testenv:lint]deps}
76+
commands =
77+
ruff check --fix {[testenv:lint]lint_dirs}
78+
ruff format {[testenv:lint]lint_dirs}
79+
7480
# Requires docker running
7581
[testenv:local-aws-kms]
7682
deps =

0 commit comments

Comments
 (0)