Skip to content

Commit

Permalink
Apply ruff/flake8-implicit-str-concat rule ISC001
Browse files Browse the repository at this point in the history
	ISC001 Implicitly concatenated string literals on one line

This rule is currently disabled because it conflicts with the formatter:
	astral-sh/ruff#8272
  • Loading branch information
DimitriPapadopoulos committed May 5, 2024
1 parent 49711ba commit bbb65c7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/cryptography/hazmat/primitives/kdf/kbkdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(

if (label or context) and fixed:
raise ValueError(
"When supplying fixed data, " "label and context are ignored."
"When supplying fixed data, label and context are ignored."
)

if rlen is None or not self._valid_byte_length(rlen):
Expand Down
10 changes: 5 additions & 5 deletions src/cryptography/x509/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ def serial_number(self, number: int) -> CertificateBuilder:
# zero.
if number.bit_length() >= 160: # As defined in RFC 5280
raise ValueError(
"The serial number should not be more than 159 " "bits."
"The serial number should not be more than 159 bits."
)
return CertificateBuilder(
self._issuer_name,
Expand Down Expand Up @@ -1047,7 +1047,7 @@ def last_update(
last_update = _convert_to_naive_utc_time(last_update)
if last_update < _EARLIEST_UTC_TIME:
raise ValueError(
"The last update date must be on or after" " 1950 January 1."
"The last update date must be on or after 1950 January 1."
)
if self._next_update is not None and last_update > self._next_update:
raise ValueError(
Expand All @@ -1071,7 +1071,7 @@ def next_update(
next_update = _convert_to_naive_utc_time(next_update)
if next_update < _EARLIEST_UTC_TIME:
raise ValueError(
"The last update date must be on or after" " 1950 January 1."
"The last update date must be on or after 1950 January 1."
)
if self._last_update is not None and next_update < self._last_update:
raise ValueError(
Expand Down Expand Up @@ -1172,7 +1172,7 @@ def serial_number(self, number: int) -> RevokedCertificateBuilder:
# zero.
if number.bit_length() >= 160: # As defined in RFC 5280
raise ValueError(
"The serial number should not be more than 159 " "bits."
"The serial number should not be more than 159 bits."
)
return RevokedCertificateBuilder(
number, self._revocation_date, self._extensions
Expand All @@ -1188,7 +1188,7 @@ def revocation_date(
time = _convert_to_naive_utc_time(time)
if time < _EARLIEST_UTC_TIME:
raise ValueError(
"The revocation date must be on or after" " 1950 January 1."
"The revocation date must be on or after 1950 January 1."
)
return RevokedCertificateBuilder(
self._serial_number, time, self._extensions
Expand Down
8 changes: 4 additions & 4 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,7 @@ def test_load_fips_ecdsa_key_pair_vectors():
{
"curve": "sect233k1",
"d": int(
"1da7422b50e3ff051f2aaaed10acea6cbf6110c517da2f4e" "aca8b5b87",
"1da7422b50e3ff051f2aaaed10acea6cbf6110c517da2f4eaca8b5b87",
16,
),
"x": int(
Expand All @@ -2738,7 +2738,7 @@ def test_load_fips_ecdsa_key_pair_vectors():
{
"curve": "sect233k1",
"d": int(
"530951158f7b1586978c196603c12d25607d2cb0557efadb" "23cd0ce8",
"530951158f7b1586978c196603c12d25607d2cb0557efadb23cd0ce8",
16,
),
"x": int(
Expand Down Expand Up @@ -3776,7 +3776,7 @@ def test_load_kasvs_ecdh_vectors():
),
},
"Z": int(
"b1259ceedfb663d9515089cf727e7024fb3d86cbcec611b4" "ba0b4ab6",
"b1259ceedfb663d9515089cf727e7024fb3d86cbcec611b4ba0b4ab6",
16,
),
"curve": "secp224r1",
Expand Down Expand Up @@ -4015,7 +4015,7 @@ def test_load_kasvs_ecdh_kdf_vectors():
16,
),
"Z": int(
"43f23b2c760d686fc99cc008b63aea92f866e224265af60d" "2d8ae540",
"43f23b2c760d686fc99cc008b63aea92f866e224265af60d2d8ae540",
16,
),
"DKM": int("ad65fa2d12541c3a21f3cd223efb", 16),
Expand Down
4 changes: 2 additions & 2 deletions tests/x509/test_ocsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ def test_load_request(self):
ocsp.load_der_ocsp_request,
)
assert req.issuer_name_hash == (
b"8\xcaF\x8c\x07D\x8d\xf4\x81\x96" b"\xc7mmLpQ\x9e`\xa7\xbd"
b"8\xcaF\x8c\x07D\x8d\xf4\x81\x96\xc7mmLpQ\x9e`\xa7\xbd"
)
assert req.issuer_key_hash == (
b"yu\xbb\x84:\xcb,\xdez\t\xbe1" b"\x1bC\xbc\x1c*MSX"
b"yu\xbb\x84:\xcb,\xdez\t\xbe1\x1bC\xbc\x1c*MSX"
)
assert isinstance(req.hash_algorithm, hashes.SHA1)
assert req.serial_number == int(
Expand Down
2 changes: 1 addition & 1 deletion tests/x509/test_x509_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -2520,7 +2520,7 @@ def test_uri(self, backend):
assert ext is not None
uri = ext.value.get_values_for_type(x509.UniformResourceIdentifier)
assert uri == [
"gopher://xn--80ato2c.cryptography:70/path?q=s#hel" "lo",
"gopher://xn--80ato2c.cryptography:70/path?q=s#hello",
"http://someregulardomain.com",
]

Expand Down

0 comments on commit bbb65c7

Please sign in to comment.