Skip to content

Commit da007e5

Browse files
committed
Switch to ruff
1 parent 8a75435 commit da007e5

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ jobs:
2323
run: pip install .[tests]
2424
- name: Test
2525
run: make test
26-
black:
27-
runs-on: ubuntu-22.04
28-
steps:
29-
- uses: actions/checkout@v4
30-
- uses: psf/black@stable
3126
isort:
3227
runs-on: ubuntu-22.04
3328
steps:
3429
- uses: actions/checkout@v4
3530
- uses: isort/[email protected]
31+
ruff:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: astral-sh/ruff-action@v1
36+
- uses: astral-sh/ruff-action@v1
37+
with:
38+
args: "format --check"

http_message_signatures/signatures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def _build_signature_base(
4646
raise HTTPMessageSignaturesException(f'Component ID "{component_key}" contains newline character')
4747
if component_key in sig_elements:
4848
raise HTTPMessageSignaturesException(
49-
f'Component ID "{component_key}" appeared multiple times in ' "signature input"
49+
f'Component ID "{component_key}" appeared multiple times in signature input'
5050
)
5151
sig_elements[component_key] = component_value
5252
sig_params_node = http_sfv.InnerList(covered_component_ids)

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ build-backend = "hatchling.build"
4646
[tool.hatch.version]
4747
source = "vcs"
4848

49-
[tool.black]
50-
line-length = 120
51-
exclude = ".*/version.py"
52-
5349
[tool.isort]
5450
profile = "black"
5551

test/test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
)
3232

3333
test_shared_secret = base64.b64decode(
34-
"uzvJfB4u3N0Jy4T7NZ75MDVcr8zSTInedJtkgcu46YW4XByzNJjxBdtjUkdJPBtbmHhIDi6pcl8jsasj" "lTMtDQ=="
34+
"uzvJfB4u3N0Jy4T7NZ75MDVcr8zSTInedJtkgcu46YW4XByzNJjxBdtjUkdJPBtbmHhIDi6pcl8jsasjlTMtDQ=="
3535
)
3636

3737

@@ -59,7 +59,7 @@ def setUp(self):
5959
self.test_request = request.prepare()
6060
self.test_request.headers["Date"] = "Tue, 20 Apr 2021 02:07:55 GMT"
6161
self.test_request.headers["Content-Digest"] = (
62-
"sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+TaPm+" "AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:"
62+
"sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+TaPm+AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:"
6363
)
6464
self.test_response = requests.Response()
6565
self.test_response.request = self.test_request
@@ -68,7 +68,7 @@ def setUp(self):
6868
"Date": "Tue, 20 Apr 2021 02:07:56 GMT",
6969
"Content-Type": "application/json",
7070
"Content-Digest": (
71-
"sha-512=:JlEy2bfUz7WrWIjc1qV6KVLpdr/7L5/L4h7Sxvh6sNHpDQWDCL+" "GauFQWcZBvVDhiyOnAQsxzZFYwi0wDH+1pw==:"
71+
"sha-512=:JlEy2bfUz7WrWIjc1qV6KVLpdr/7L5/L4h7Sxvh6sNHpDQWDCL+GauFQWcZBvVDhiyOnAQsxzZFYwi0wDH+1pw==:"
7272
),
7373
"Content-Length": "23",
7474
}
@@ -205,7 +205,7 @@ def test_http_message_signatures_B24(self):
205205
verifier = HTTPMessageVerifier(signature_algorithm=ECDSA_P256_SHA256, key_resolver=self.key_resolver)
206206
self.verify(verifier, self.test_response)
207207
self.test_response.headers["Signature"] = (
208-
"sig-b24=:0Ry6HsvzS5VmA6HlfBYS/fYYeNs7fYuA7s0tAdxfUlPGv0CSVuwrrzBOjc" "CFHTxVRJ01wjvSzM2BetJauj8dsw==:"
208+
"sig-b24=:0Ry6HsvzS5VmA6HlfBYS/fYYeNs7fYuA7s0tAdxfUlPGv0CSVuwrrzBOjcCFHTxVRJ01wjvSzM2BetJauj8dsw==:"
209209
)
210210
self.verify(verifier, self.test_response)
211211

0 commit comments

Comments
 (0)