Skip to content

Commit 315537c

Browse files
authored
♻️ Sync ruff version in workflows (openwallet-foundation#3447)
* ⬆️ Sync ruff version in pre-commit and github workflow Signed-off-by: ff137 <[email protected]> * 🎨 Update note about syncing ruff version Signed-off-by: ff137 <[email protected]> * 🎨 Apply new ruff format Signed-off-by: ff137 <[email protected]> --------- Signed-off-by: ff137 <[email protected]>
1 parent cd3a623 commit 315537c

File tree

46 files changed

+89
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+89
-128
lines changed

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
- name: Ruff Format and Lint Check
1818
uses: chartboost/ruff-action@v1
1919
with:
20-
version: 0.8.0
20+
version: 0.9.1
2121
args: "format --check"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
additional_dependencies: ['@commitlint/config-conventional']
99
- repo: https://github.com/astral-sh/ruff-pre-commit
1010
# Ensure this is synced with pyproject.toml
11-
rev: v0.8.1
11+
rev: v0.9.1
1212
hooks:
1313
# Run the linter
1414
- id: ruff

acapy_agent/anoncreds/issuer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async def create_and_register_schema(
196196
)
197197
if schemas:
198198
raise AnonCredsSchemaAlreadyExists(
199-
f"Schema with {name}: {version} " f"already exists for {issuer_id}",
199+
f"Schema with {name}: {version} already exists for {issuer_id}",
200200
schemas[0].name,
201201
AnonCredsSchema.deserialize(schemas[0].value_json),
202202
)

acapy_agent/anoncreds/revocation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ async def set_active_registry(self, rev_reg_def_id: str):
345345
)
346346
if not entry:
347347
raise AnonCredsRevocationError(
348-
f"{CATEGORY_REV_REG_DEF} with id "
349-
f"{rev_reg_def_id} could not be found"
348+
f"{CATEGORY_REV_REG_DEF} with id {rev_reg_def_id} could not be found"
350349
)
351350

352351
if entry.tags["active"] == json.dumps(True):

acapy_agent/anoncreds/verifier.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,7 @@ async def check_timestamps(
205205
)
206206
elif uuid in unrevealed_attrs:
207207
# nothing to do, attribute value is not revealed
208-
msgs.append(
209-
f"{PresVerifyMsg.CT_UNREVEALED_ATTRIBUTES.value}::" f"{uuid}"
210-
)
208+
msgs.append(f"{PresVerifyMsg.CT_UNREVEALED_ATTRIBUTES.value}::{uuid}")
211209
elif uuid not in self_attested:
212210
raise ValueError(
213211
f"Presentation attributes mismatch requested attribute {uuid}"
@@ -236,8 +234,7 @@ async def check_timestamps(
236234
< non_revoc_intervals[uuid].get("to", now)
237235
):
238236
msgs.append(
239-
f"{PresVerifyMsg.TSTMP_OUT_NON_REVOC_INTRVAL.value}::"
240-
f"{uuid}"
237+
f"{PresVerifyMsg.TSTMP_OUT_NON_REVOC_INTRVAL.value}::{uuid}"
241238
)
242239
LOGGER.warning(
243240
f"Timestamp {timestamp} from ledger for item"
@@ -266,7 +263,7 @@ async def check_timestamps(
266263
< non_revoc_intervals[uuid].get("to", now)
267264
):
268265
msgs.append(
269-
f"{PresVerifyMsg.TSTMP_OUT_NON_REVOC_INTRVAL.value}::" f"{uuid}"
266+
f"{PresVerifyMsg.TSTMP_OUT_NON_REVOC_INTRVAL.value}::{uuid}"
270267
)
271268
LOGGER.warning(
272269
f"Best-effort timestamp {timestamp} "
@@ -333,9 +330,7 @@ async def pre_verify(self, pres_req: dict, pres: dict) -> list:
333330
elif uuid in unrevealed_attrs:
334331
# unrevealed attribute, nothing to do
335332
pres_req_attr_spec = {}
336-
msgs.append(
337-
f"{PresVerifyMsg.CT_UNREVEALED_ATTRIBUTES.value}::" f"{uuid}"
338-
)
333+
msgs.append(f"{PresVerifyMsg.CT_UNREVEALED_ATTRIBUTES.value}::{uuid}")
339334
elif uuid in self_attested:
340335
if not req_attr.get("restrictions"):
341336
continue

acapy_agent/config/argparse.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,24 +269,22 @@ def add_arguments(self, parser: ArgumentParser):
269269
action="store_true",
270270
env_var="ACAPY_DEBUG_CREDENTIALS",
271271
help=(
272-
"Enable additional logging around credential exchanges. "
273-
"Default: false."
272+
"Enable additional logging around credential exchanges. Default: false."
274273
),
275274
)
276275
parser.add_argument(
277276
"--debug-presentations",
278277
action="store_true",
279278
env_var="ACAPY_DEBUG_PRESENTATIONS",
280279
help=(
281-
"Enable additional logging around presentation exchanges. "
282-
"Default: false."
280+
"Enable additional logging around presentation exchanges. Default: false."
283281
),
284282
)
285283
parser.add_argument(
286284
"--debug-webhooks",
287285
action="store_true",
288286
env_var="ACAPY_DEBUG_WEBHOOKS",
289-
help=("Emit protocol state object as webhook. " "Default: false."),
287+
help=("Emit protocol state object as webhook. Default: false."),
290288
)
291289
parser.add_argument(
292290
"--invite",
@@ -416,17 +414,15 @@ def add_arguments(self, parser: ArgumentParser):
416414
action="store_true",
417415
env_var="ACAPY_AUTO_STORE_CREDENTIAL",
418416
help=(
419-
"Automatically store an issued credential upon receipt. "
420-
"Default: false."
417+
"Automatically store an issued credential upon receipt. Default: false."
421418
),
422419
)
423420
parser.add_argument(
424421
"--auto-verify-presentation",
425422
action="store_true",
426423
env_var="ACAPY_AUTO_VERIFY_PRESENTATION",
427424
help=(
428-
"Automatically verify a presentation when it is received. "
429-
"Default: false."
425+
"Automatically verify a presentation when it is received. Default: false."
430426
),
431427
)
432428

acapy_agent/config/ledger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ async def select_aml_tty(taa_info, provision: bool = False) -> Optional[str]:
220220
num_mechanisms = {}
221221
for idx, opt in enumerate(found):
222222
num_mechanisms[str(idx + 1)] = opt
223-
opts.append(f" {idx+1}. {allow_opts[opt]}")
223+
opts.append(f" {idx + 1}. {allow_opts[opt]}")
224224
opts.append(" X. Skip the transaction author agreement")
225225
opts_text = "\nPlease select an option:\n" + "\n".join(opts) + "\n[1]> "
226226

acapy_agent/connections/base_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,7 @@ async def resolve_inbound_connection(
10261026
receipt.recipient_did_public = True
10271027
except InjectionError:
10281028
self._logger.warning(
1029-
"Cannot resolve recipient verkey, no wallet defined by "
1030-
"context: %s",
1029+
"Cannot resolve recipient verkey, no wallet defined by context: %s",
10311030
receipt.recipient_verkey,
10321031
)
10331032
except WalletNotFoundError:

acapy_agent/indy/models/tests/test_pres_preview.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@
8888
"name": "player",
8989
"restrictions": [
9090
{{
91-
"cred_def_id": "{CD_ID['score']}"
91+
"cred_def_id": "{CD_ID["score"]}"
9292
}}
9393
]
9494
}},
9595
"1_screencapture_uuid": {{
9696
"name": "screenCapture",
9797
"restrictions": [
9898
{{
99-
"cred_def_id": "{CD_ID['score']}"
99+
"cred_def_id": "{CD_ID["score"]}"
100100
}}
101101
]
102102
}}
@@ -108,7 +108,7 @@
108108
"p_value": 1000000,
109109
"restrictions": [
110110
{{
111-
"cred_def_id": "{CD_ID['score']}"
111+
"cred_def_id": "{CD_ID["score"]}"
112112
}}
113113
]
114114
}}
@@ -125,15 +125,15 @@
125125
"names": ["player", "screenCapture"],
126126
"restrictions": [
127127
{{
128-
"cred_def_id": "{CD_ID['score']}"
128+
"cred_def_id": "{CD_ID["score"]}"
129129
}}
130130
]
131131
}},
132132
"1_member_uuid": {{
133133
"names": ["member", "since"],
134134
"restrictions": [
135135
{{
136-
"cred_def_id": "{CD_ID['membership']}"
136+
"cred_def_id": "{CD_ID["membership"]}"
137137
}}
138138
]
139139
}}

acapy_agent/indy/verifier.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ async def check_timestamps(
211211
)
212212
elif uuid in unrevealed_attrs:
213213
# nothing to do, attribute value is not revealed
214-
msgs.append(
215-
f"{PresVerifyMsg.CT_UNREVEALED_ATTRIBUTES.value}::" f"{uuid}"
216-
)
214+
msgs.append(f"{PresVerifyMsg.CT_UNREVEALED_ATTRIBUTES.value}::{uuid}")
217215
elif uuid not in self_attested:
218216
raise ValueError(
219217
f"Presentation attributes mismatch requested attribute {uuid}"
@@ -242,8 +240,7 @@ async def check_timestamps(
242240
< non_revoc_intervals[uuid].get("to", now)
243241
):
244242
msgs.append(
245-
f"{PresVerifyMsg.TSTMP_OUT_NON_REVOC_INTRVAL.value}::"
246-
f"{uuid}"
243+
f"{PresVerifyMsg.TSTMP_OUT_NON_REVOC_INTRVAL.value}::{uuid}"
247244
)
248245
LOGGER.warning(
249246
f"Timestamp {timestamp} from ledger for item"
@@ -272,7 +269,7 @@ async def check_timestamps(
272269
< non_revoc_intervals[uuid].get("to", now)
273270
):
274271
msgs.append(
275-
f"{PresVerifyMsg.TSTMP_OUT_NON_REVOC_INTRVAL.value}::" f"{uuid}"
272+
f"{PresVerifyMsg.TSTMP_OUT_NON_REVOC_INTRVAL.value}::{uuid}"
276273
)
277274
LOGGER.warning(
278275
f"Best-effort timestamp {timestamp} "
@@ -339,9 +336,7 @@ async def pre_verify(self, pres_req: dict, pres: dict) -> list:
339336
elif uuid in unrevealed_attrs:
340337
# unrevealed attribute, nothing to do
341338
pres_req_attr_spec = {}
342-
msgs.append(
343-
f"{PresVerifyMsg.CT_UNREVEALED_ATTRIBUTES.value}::" f"{uuid}"
344-
)
339+
msgs.append(f"{PresVerifyMsg.CT_UNREVEALED_ATTRIBUTES.value}::{uuid}")
345340
elif uuid in self_attested:
346341
if not req_attr.get("restrictions"):
347342
continue

0 commit comments

Comments
 (0)