Skip to content

Commit b297b0e

Browse files
committed
chore: remove pyrefly ignore comments from codebase
Clean up unnecessary `# pyrefly: ignore` comments throughout the codebase. This improves code readability and reduces clutter. No functional changes were made. Also, minor variable renaming for unused values and type annotations added for clarity.
1 parent cfb273e commit b297b0e

File tree

16 files changed

+15
-34
lines changed

16 files changed

+15
-34
lines changed

.github/regression.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ _cleanup() {
157157
fi
158158
}
159159

160+
# shellcheck disable=SC2329
160161
_cleanup_testnet_on_interrupt() {
161162
[ -z "${BOOTSTRAP_DIR:-""}" ] && return
162163

@@ -185,6 +186,7 @@ _cleanup_testnet_on_interrupt() {
185186
}
186187
187188
# cleanup on Ctrl+C or error
189+
# shellcheck disable=SC2329
188190
_interrupted() {
189191
# Do testnet cleanup only on interrupted testrun. When not interrupted,
190192
# cleanup is done as part of a testrun.

cardano_node_tests/cardano_cli_coverage.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,9 @@ def merge_coverage(dict_a: dict, dict_b: dict) -> dict:
101101
mergeable = (list, set, tuple)
102102
addable = (int, float)
103103
for key, value in dict_b.items():
104-
# pyrefly: ignore # invalid-argument
105104
if key in dict_a and isinstance(value, mergeable) and isinstance(dict_a[key], mergeable):
106105
new_list = set(dict_a[key]).union(value)
107106
dict_a[key] = sorted(new_list)
108-
# pyrefly: ignore # invalid-argument
109107
elif key in dict_a and isinstance(value, addable) and isinstance(dict_a[key], addable):
110108
dict_a[key] += value
111109
# Skipped arguments and commands are not in the available commands dict
@@ -124,7 +122,6 @@ def cli(cli_args: tp.Iterable[str]) -> str:
124122
assert not isinstance(cli_args, str), "`cli_args` must be sequence of strings"
125123
with subprocess.Popen(list(cli_args), stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p:
126124
__, stderr = p.communicate()
127-
# pyrefly: ignore # missing-attribute
128125
return stderr.decode()
129126

130127

cardano_node_tests/tests/test_mnemonic.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
LOGGER = logging.getLogger(__name__)
2020
DATA_DIR = pl.Path(__file__).parent / "data" / "mnemonic_golden"
2121

22-
# pyrefly: ignore # no-matching-overload
2322
KEY_TYPES = tuple(clusterlib.KeyType)
2423
KEY_TYPE_IDS = tuple(k.value.replace("-", "_") for k in KEY_TYPES)
25-
# pyrefly: ignore # no-matching-overload
2624
OUT_FORMATS = tuple(clusterlib.OutputFormat)
2725
OUT_FORMAT_IDS = tuple(k.value.replace("-", "_") for k in OUT_FORMATS)
2826

cardano_node_tests/tests/test_scripts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ def test_before_future(
16081608
build_method = request.node.callspec.params["fund_script_before_slot_in_future"]
16091609
temp_template = f"{common.get_test_id(cluster)}_{common.unique_time_str()}"
16101610

1611-
multisig_script, script_address, script_utxos, tx_output, before_slot = (
1611+
multisig_script, _script_address, script_utxos, tx_output, before_slot = (
16121612
fund_script_before_slot_in_future
16131613
)
16141614

@@ -1665,7 +1665,7 @@ def test_after_future(
16651665
build_method = request.node.callspec.params["fund_script_after_slot_in_future"]
16661666
temp_template = f"{common.get_test_id(cluster)}_{common.unique_time_str()}"
16671667

1668-
multisig_script, script_address, script_utxos, tx_output, after_slot = (
1668+
multisig_script, _script_address, script_utxos, tx_output, after_slot = (
16691669
fund_script_after_slot_in_future
16701670
)
16711671

@@ -1742,7 +1742,7 @@ def test_after_past(
17421742
build_method = request.node.callspec.params["fund_script_after_slot_in_past"]
17431743
temp_template = f"{common.get_test_id(cluster)}_{common.unique_time_str()}"
17441744

1745-
multisig_script, script_address, script_utxos, tx_output, after_slot = (
1745+
multisig_script, _script_address, script_utxos, tx_output, after_slot = (
17461746
fund_script_after_slot_in_past
17471747
)
17481748

cardano_node_tests/tests/tests_conway/test_constitution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def governance_w_scripts_lg(
305305
],
306306
) -> governance_utils.GovernanceRecords:
307307
"""Create a governance records with script DReps."""
308-
cluster, default_governance = cluster_lock_gov_script
308+
_cluster, default_governance = cluster_lock_gov_script
309309
script_dreps, script_delegators = script_dreps_lg
310310
return dataclasses.replace(
311311
default_governance, drep_scripts_reg=script_dreps, drep_scripts_delegators=script_delegators

cardano_node_tests/tests/tests_conway/test_pparam_update.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,6 @@ def _propose_pparams_update(
696696
anchor_data = governance_utils.get_default_anchor_data()
697697
# Increment count for a submitted proposal
698698
nonlocal submitted_proposal_count
699-
# pyrefly: ignore # unknown-name
700699
submitted_proposal_count += 1
701700
return conway_common.propose_pparams_update(
702701
cluster_obj=cluster,

cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ def test_enact_treasury_withdrawals(
262262
def _cast_vote(
263263
approve: bool, vote_id: str, add_spo_votes: bool = False
264264
) -> governance_utils.VotedVotes:
265-
votes_cc = []
266-
votes_drep = []
267-
votes_spo = []
265+
votes_cc: list[clusterlib.VoteCC] = []
266+
votes_drep: list[clusterlib.VoteDrep] = []
267+
votes_spo: list[clusterlib.VoteSPO] = []
268268
for action_ix in range(actions_num):
269269
votes_cc.extend(
270270
[

cardano_node_tests/tests/tests_plutus/test_delegation.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,6 @@ def test_register_deregister(
624624

625625
# Step 3: withdraw rewards and deregister
626626

627-
reward_error = ""
628-
629627
# Make sure we have enough time to finish deregistration in one epoch
630628
clusterlib_utils.wait_for_epoch_interval(
631629
cluster_obj=cluster, start=5, stop=common.EPOCH_STOP_SEC_BUFFER
@@ -647,9 +645,6 @@ def test_register_deregister(
647645
),
648646
)
649647

650-
if reward_error:
651-
raise AssertionError(reward_error)
652-
653648
# Check tx_view of step 2 and step 3
654649
tx_view.check_tx_view(cluster_obj=cluster, tx_raw_output=tx_raw_output_reg)
655650
tx_view.check_tx_view(cluster_obj=cluster, tx_raw_output=tx_raw_output_dereg)

cardano_node_tests/tests/tests_plutus/test_mint_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def test_minting_missing_txout(
272272

273273
# Step 1: fund the token issuer and create UTXO for collaterals
274274

275-
mint_utxos, collateral_utxos, tx_output_step1 = mint_build._fund_issuer(
275+
mint_utxos, collateral_utxos, _tx_output_step1 = mint_build._fund_issuer(
276276
cluster_obj=cluster,
277277
temp_template=temp_template,
278278
payment_addr=payment_addr,

cardano_node_tests/tests/tests_plutus_v2/mint_raw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def check_missing_builtin(
127127

128128
# Step 1: fund the token issuer
129129

130-
mint_utxos, collateral_utxos, __, tx_raw_output_step1 = _fund_issuer(
130+
mint_utxos, collateral_utxos, *__ = _fund_issuer(
131131
cluster_obj=cluster_obj,
132132
temp_template=temp_template,
133133
payment_addr=payment_addr,

0 commit comments

Comments
 (0)