Skip to content
Snippets Groups Projects
Commit aee6d355 authored by Moul's avatar Moul
Browse files

pre-commit autoupgrade

Isort got broken
Apply new black changes
Fix Pylint report
Mypy v1.0
parent 5ebe942a
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
rev: v2.0.1
hooks:
- id: autoflake
args:
......@@ -22,20 +22,20 @@ repos:
- --remove-unused-variables
- --in-place
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.11.4
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
rev: v1.0.1
hooks:
- id: mypy
- repo: https://github.com/PyCQA/pylint
rev: v2.15.10
rev: v2.16.2
hooks:
- id: pylint
- repo: https://github.com/asottile/pyupgrade
......@@ -51,7 +51,7 @@ repos:
- "--server"
- "https://git.duniter.org"
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.1
rev: v1.4.2
hooks:
- id: insert-license
files: \.py$
......
......@@ -80,7 +80,7 @@ def auth_by_auth_file(ctx: Context) -> SigningKey:
authfile = Path(file)
if not authfile.is_file():
sys.exit(f"Error: `{file}` file does not exist")
filetxt = authfile.open("r", encoding="utf-8").read()
filetxt = authfile.read_text(encoding="utf-8")
# two regural expressions for the PubSec format
regex_pubkey = re.compile(PUBSEC_PUBKEY_PATTERN, re.MULTILINE)
......
......@@ -32,7 +32,6 @@ from silkaj.wot import tools as wt
@pass_context
def balance_cmd(ctx: Context, pubkeys: str) -> None:
if not has_auth_method():
# check input pubkeys
if not pubkeys:
sys.exit("You should specify one or many pubkeys")
......
......@@ -502,7 +502,6 @@ def generate_transaction_document(
Comment: str = "",
OutputbackChange: Optional[str] = None,
) -> Transaction:
listinput = listinput_and_amount[0]
totalAmountInput = listinput_and_amount[1]
total_tx_amount = sum(tx_amounts)
......
......@@ -134,7 +134,6 @@ Optionnaly takes the document filename.",
)
@click.pass_context
def publish(ctx: click.Context, file: str) -> None:
warn_before_dry_run_or_display(ctx)
rev_doc = verify_document(file)
......
......@@ -371,7 +371,6 @@ uid: {idty1.uid}\npubkey: {gen_pubkey_checksum(idty1.pubkey)}"
def test_check_many_identities(
idty, lookup_pk, lookup_uid, expected, expect_bool, monkeypatch, capsys
):
# Patch BMA lookup so it returns different lookups if we request a pk or a uid
def patched_bma_lookup(whatever_node, lookup):
# raise errors if no matching identity
......
......@@ -138,6 +138,7 @@ def patched_send_bma_revoke_error(wot_useless, rev_doc_useless):
# tests
# test cli dry-run
@pytest.mark.parametrize(
"subcommand, expected_warn",
......@@ -890,7 +891,6 @@ def test_revocation_cli_revoke(
],
)
def test_revocation_cli_revoke_errors(display, user_input, doc, expected, monkeypatch):
monkeypatch.setattr(auth, "auth_method", patched_auth_method_Claude)
monkeypatch.setattr(bc_tools, "get_head_block", patched_get_head_block_gtest)
monkeypatch.setattr(w_tools, "choose_identity", patched_choose_identity)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment