Skip to content

Commit b6a931c

Browse files
committed
refactor: remove pylint disable comments
Removed unnecessary pylint disable comments from various files in the cardano_clusterlib module. We no longer use pylint.
1 parent 10df993 commit b6a931c

10 files changed

+1
-32
lines changed

cardano_clusterlib/clusterlib.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Import everything that used to be available here for backwards compatibility.
44
"""
55

6-
# pylint: disable=unused-import
76
# flake8: noqa
87
from cardano_clusterlib.clusterlib_klass import ClusterLib
98
from cardano_clusterlib.consts import CommandEras

cardano_clusterlib/clusterlib_klass.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,13 @@ class ClusterLib:
4242
command_era: An era used for CLI commands, by default same as the latest network Era.
4343
"""
4444

45-
# pylint: disable=too-many-instance-attributes
46-
4745
def __init__(
4846
self,
4947
state_dir: itp.FileType,
5048
slots_offset: int | None = None,
5149
socket_path: itp.FileType = "",
5250
command_era: str = consts.CommandEras.LATEST,
5351
):
54-
# pylint: disable=too-many-statements
5552
try:
5653
self.command_era = getattr(consts.CommandEras, command_era.upper())
5754
except AttributeError as excp:

cardano_clusterlib/conway_gov_action_group.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ def create_constitution(
145145
destination_dir: itp.FileType = ".",
146146
) -> structs.ActionConstitution:
147147
"""Create a constitution."""
148-
# pylint: disable=too-many-arguments
149148
destination_dir = pl.Path(destination_dir).expanduser()
150149
out_file = destination_dir / f"{action_name}_constitution.action"
151150
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)
@@ -224,7 +223,6 @@ def create_info(
224223
destination_dir: itp.FileType = ".",
225224
) -> structs.ActionInfo:
226225
"""Create an info action."""
227-
# pylint: disable=too-many-arguments
228226
destination_dir = pl.Path(destination_dir).expanduser()
229227
out_file = destination_dir / f"{action_name}_info.action"
230228
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)
@@ -280,7 +278,6 @@ def create_no_confidence(
280278
destination_dir: itp.FileType = ".",
281279
) -> structs.ActionNoConfidence:
282280
"""Create a no confidence proposal."""
283-
# pylint: disable=too-many-arguments
284281
destination_dir = pl.Path(destination_dir).expanduser()
285282
out_file = destination_dir / f"{action_name}_confidence.action"
286283
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)
@@ -349,7 +346,6 @@ def update_committee(
349346
destination_dir: itp.FileType = ".",
350347
) -> structs.ActionUpdateCommittee:
351348
"""Create or update a new committee proposal."""
352-
# pylint: disable=too-many-arguments
353349
destination_dir = pl.Path(destination_dir).expanduser()
354350
out_file = destination_dir / f"{action_name}_update_committee.action"
355351
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)
@@ -425,7 +421,6 @@ def create_pparams_update(
425421
destination_dir: itp.FileType = ".",
426422
) -> structs.ActionPParamsUpdate:
427423
"""Create a protocol parameters update proposal."""
428-
# pylint: disable=too-many-arguments
429424
destination_dir = pl.Path(destination_dir).expanduser()
430425
out_file = destination_dir / f"{action_name}_pparams_update.action"
431426
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)
@@ -492,7 +487,6 @@ def create_treasury_withdrawal(
492487
destination_dir: itp.FileType = ".",
493488
) -> structs.ActionTreasuryWithdrawal:
494489
"""Create a treasury withdrawal."""
495-
# pylint: disable=too-many-arguments
496490
destination_dir = pl.Path(destination_dir).expanduser()
497491
out_file = destination_dir / f"{action_name}_info.action"
498492
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)
@@ -594,7 +588,6 @@ def create_hardfork(
594588
destination_dir: itp.FileType = ".",
595589
) -> structs.ActionHardfork:
596590
"""Create a hardfork initiation proposal."""
597-
# pylint: disable=too-many-arguments
598591
destination_dir = pl.Path(destination_dir).expanduser()
599592
out_file = destination_dir / f"{action_name}_hardfork.action"
600593
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)

cardano_clusterlib/conway_gov_vote_group.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def create_committee(
8181
destination_dir: itp.FileType = ".",
8282
) -> structs.VoteCC:
8383
"""Create a governance action vote for a commitee member."""
84-
# pylint: disable=too-many-arguments
8584
destination_dir = pl.Path(destination_dir).expanduser()
8685
out_file = destination_dir / f"{vote_name}_cc.vote"
8786
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)
@@ -147,7 +146,6 @@ def create_drep(
147146
destination_dir: itp.FileType = ".",
148147
) -> structs.VoteDrep:
149148
"""Create a governance action vote for a DRep."""
150-
# pylint: disable=too-many-arguments
151149
destination_dir = pl.Path(destination_dir).expanduser()
152150
out_file = destination_dir / f"{vote_name}_drep.vote"
153151
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)
@@ -212,7 +210,6 @@ def create_spo(
212210
destination_dir: itp.FileType = ".",
213211
) -> structs.VoteSPO:
214212
"""Create a governance action vote for an SPO."""
215-
# pylint: disable=too-many-arguments
216213
destination_dir = pl.Path(destination_dir).expanduser()
217214
out_file = destination_dir / f"{vote_name}_spo.vote"
218215
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)

cardano_clusterlib/query_group.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121

2222
class QueryGroup:
23-
# pylint: disable=too-many-public-methods
24-
2523
def __init__(self, clusterlib_obj: "itp.ClusterLib") -> None:
2624
self._clusterlib_obj = clusterlib_obj
2725

cardano_clusterlib/stake_address_group.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ def gen_vote_delegation_cert(
353353
Returns:
354354
Path: A path to the generated certificate.
355355
"""
356-
# pylint: disable=too-many-arguments
357356
if not self._clusterlib_obj.conway_genesis:
358357
msg = "Conway governance can be used only with Command era >= Conway."
359358
raise exceptions.CLIError(msg)
@@ -433,7 +432,6 @@ def gen_stake_and_vote_delegation_cert(
433432
Returns:
434433
Path: A path to the generated certificate.
435434
"""
436-
# pylint: disable=too-many-arguments
437435
if not self._clusterlib_obj.conway_genesis:
438436
msg = "Conway governance can be used only with Command era >= Conway."
439437
raise exceptions.CLIError(msg)

cardano_clusterlib/structs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class TxOut:
8080
# List of `TxOut`s, empty list, or empty tuple
8181
OptionalTxOuts = list[TxOut] | tuple[()]
8282
# List of `UTXOData`s, empty list, or empty tuple
83-
OptionalUTXOData = list[UTXOData] | tuple[()] # pylint: disable=invalid-name
83+
OptionalUTXOData = list[UTXOData] | tuple[()]
8484

8585

8686
@dataclasses.dataclass(frozen=True, order=True)

cardano_clusterlib/transaction_group.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ def build_raw_tx_bare( # noqa: C901
241241
Returns:
242242
structs.TxRawOutput: A tuple with transaction output details.
243243
"""
244-
# pylint: disable=too-many-arguments,too-many-branches,too-many-locals,too-many-statements
245244
if (treasury_donation is not None) != (current_treasury_value is not None):
246245
msg = (
247246
"Both `treasury_donation` and `current_treasury_value` must be specified together."
@@ -475,7 +474,6 @@ def build_raw_tx(
475474
Returns:
476475
structs.TxRawOutput: A tuple with transaction output details.
477476
"""
478-
# pylint: disable=too-many-arguments
479477
destination_dir = pl.Path(destination_dir).expanduser()
480478
out_file = destination_dir / f"{tx_name}_tx.body"
481479
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)
@@ -664,7 +662,6 @@ def calculate_tx_fee(
664662
Returns:
665663
int: An estimated fee.
666664
"""
667-
# pylint: disable=too-many-arguments
668665
tx_files = tx_files or structs.TxFiles()
669666
tx_name = f"{tx_name}_estimate"
670667

@@ -836,7 +833,6 @@ def build_tx( # noqa: C901
836833
Returns:
837834
structs.TxRawOutput: A tuple with transaction output details.
838835
"""
839-
# pylint: disable=too-many-arguments,too-many-locals,too-many-statements,too-many-branches
840836
max_txout = [o for o in txouts if o.amount == -1 and o.coin in ("", consts.DEFAULT_COIN)]
841837
if max_txout:
842838
if change_address:
@@ -1303,7 +1299,6 @@ def send_tx(
13031299
Returns:
13041300
structs.TxRawOutput: A tuple with transaction output details.
13051301
"""
1306-
# pylint: disable=too-many-arguments
13071302
tx_files = tx_files or structs.TxFiles()
13081303

13091304
# Resolve withdrawal amounts here (where -1 for total rewards amount is used) so the
@@ -1549,7 +1544,6 @@ def calculate_plutus_script_cost(
15491544
Returns:
15501545
List[dict]: A Plutus scripts cost data.
15511546
"""
1552-
# pylint: disable=too-many-arguments,unused-argument
15531547
# Collect all arguments that will be passed to `build_tx`
15541548
kwargs = locals()
15551549
kwargs.pop("self", None)
@@ -1598,7 +1592,6 @@ def send_funds(
15981592
Returns:
15991593
structs.TxRawOutput: A tuple with transaction output details.
16001594
"""
1601-
# pylint: disable=too-many-arguments
16021595
warnings.warn(
16031596
"`send_funds` is deprecated, use `send_tx` instead",
16041597
DeprecationWarning,

cardano_clusterlib/txtools.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,6 @@ def _get_return_collateral_txout_args(txouts: structs.OptionalTxOuts) -> list[st
612612
txout_records = [
613613
f"{t.amount} {t.coin if t.coin != consts.DEFAULT_COIN else ''}".rstrip() for t in txouts
614614
]
615-
# pylint: disable=consider-using-f-string
616615
address_value = "{}+{}".format(txouts[0].address, "+".join(txout_records))
617616
txout_args = ["--tx-out-return-collateral", address_value]
618617

@@ -662,8 +661,6 @@ def _get_tx_ins_outs(
662661
Tuple[list, list]: A tuple of list of transaction inputs and list of transaction
663662
outputs.
664663
"""
665-
# pylint: disable=too-many-arguments
666-
667664
txouts_passed_db: dict[str, list[structs.TxOut]] = _organize_tx_ins_outs_by_coin(txouts)
668665
txouts_mint_db: dict[str, list[structs.TxOut]] = _organize_tx_ins_outs_by_coin(mint_txouts)
669666
outcoins_all = {consts.DEFAULT_COIN, *txouts_mint_db.keys(), *txouts_passed_db.keys()}
@@ -793,7 +790,6 @@ def collect_data_for_build(
793790
Returns:
794791
structs.DataForBuild: A tuple with data for build(-raw) commands.
795792
"""
796-
# pylint: disable=too-many-arguments
797793
tx_files = tx_files or structs.TxFiles()
798794

799795
withdrawals, script_withdrawals, withdrawals_txouts = _get_withdrawals(
@@ -1027,7 +1023,6 @@ def _get_script_args( # noqa: C901
10271023
script_votes: structs.OptionalScriptVotes,
10281024
for_build: bool = True,
10291025
) -> list[str]:
1030-
# pylint: disable=too-many-statements,too-many-branches
10311026
grouped_args: list[str] = []
10321027
collaterals_all = set()
10331028

cardano_clusterlib/types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import typing as tp
33

44
if tp.TYPE_CHECKING:
5-
# pylint: disable=unused-import
65
from cardano_clusterlib.clusterlib_klass import ClusterLib # noqa: F401
76

87
FileType = str | pl.Path

0 commit comments

Comments
 (0)