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

Bump pre-commit hooks

Fix mypy and pylint new reports
parent 6950777f
No related branches found
No related tags found
1 merge request!175Poetry v1.2, pytest-clarity, runners, coverage, bump deps
Pipeline #17536 waiting for manual action
exclude: ^docs/ exclude: ^docs/
repos: repos:
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 22.3.0 rev: 22.10.0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/PyCQA/isort - repo: https://github.com/PyCQA/isort
...@@ -10,23 +10,23 @@ repos: ...@@ -10,23 +10,23 @@ repos:
- id: isort - id: isort
args: ["--profile", "black"] args: ["--profile", "black"]
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.950 rev: v0.982
hooks: hooks:
- id: mypy - id: mypy
args: args:
- "--install-types" - "--install-types"
- "--non-interactive" - "--non-interactive"
- repo: https://github.com/PyCQA/pylint - repo: https://github.com/PyCQA/pylint
rev: v2.13.8 rev: v2.15.4
hooks: hooks:
- id: pylint - id: pylint
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v2.32.1 rev: v3.1.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py37-plus] args: [--py37-plus]
- repo: https://github.com/Lucas-C/pre-commit-hooks - repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.13 rev: v1.3.1
hooks: hooks:
- id: insert-license - id: insert-license
files: \.py$ files: \.py$
......
...@@ -65,14 +65,14 @@ class ParserMissingPublicKeysException(Exception): ...@@ -65,14 +65,14 @@ class ParserMissingPublicKeysException(Exception):
# Exception messages listed here # Exception messages listed here
PARSER_MISSING_SIGNING_KEY_EXCEPTION = ParserMissingSigningKeyException( PARSER_MISSING_SIGNING_KEY_EXCEPTION = ParserMissingSigningKeyException(
"The message is encrypted but no SigningKey " "instance is provided" "The message is encrypted but no SigningKey instance is provided"
) )
PARSER_MISSING_PUBLIC_KEYS_EXCEPTION = ParserMissingPublicKeysException( PARSER_MISSING_PUBLIC_KEYS_EXCEPTION = ParserMissingPublicKeysException(
"At least one signature but no public keys " "are provided" "At least one signature but no public keys are provided"
) )
MISSING_PUBLIC_KEY_AND_SIGNING_KEY_EXCEPTION = MissingPublickeyAndSigningKeyException( MISSING_PUBLIC_KEY_AND_SIGNING_KEY_EXCEPTION = MissingPublickeyAndSigningKeyException(
"Ascii Armor Message needs a " "public key or a SigningKey but " "none are provided" "Ascii Armor Message needs a public key or a SigningKey but none are provided"
) )
......
...@@ -77,7 +77,9 @@ class SigningKey(libnacl.sign.Signer): ...@@ -77,7 +77,9 @@ class SigningKey(libnacl.sign.Signer):
@classmethod @classmethod
def from_credentials_file( def from_credentials_file(
cls, path: str, scrypt_params: Optional[ScryptParams] = None cls: Type[SigningKeyType],
path: str,
scrypt_params: Optional[ScryptParams] = None,
) -> SigningKeyType: ) -> SigningKeyType:
""" """
Create a SigningKey object from a credentials file Create a SigningKey object from a credentials file
...@@ -108,7 +110,7 @@ class SigningKey(libnacl.sign.Signer): ...@@ -108,7 +110,7 @@ class SigningKey(libnacl.sign.Signer):
fh.write(seedhex) fh.write(seedhex)
@staticmethod @staticmethod
def from_seedhex_file(path: str) -> SigningKeyType: def from_seedhex_file(path: str) -> Type[SigningKeyType]:
""" """
Return SigningKey instance from Seedhex file Return SigningKey instance from Seedhex file
...@@ -142,7 +144,7 @@ class SigningKey(libnacl.sign.Signer): ...@@ -142,7 +144,7 @@ class SigningKey(libnacl.sign.Signer):
self.save(path) self.save(path)
@staticmethod @staticmethod
def from_private_key(path: str) -> SigningKeyType: def from_private_key(path: str) -> Type[SigningKeyType]:
""" """
Read authentication file Read authentication file
Add public key attribute Add public key attribute
...@@ -222,7 +224,7 @@ sec: {base58_signing_key}" ...@@ -222,7 +224,7 @@ sec: {base58_signing_key}"
@staticmethod @staticmethod
def from_wif_or_ewif_file( def from_wif_or_ewif_file(
path: str, password: Optional[str] = None path: str, password: Optional[str] = None
) -> SigningKeyType: ) -> Type[SigningKeyType]:
""" """
Return SigningKey instance from Duniter WIF or EWIF file Return SigningKey instance from Duniter WIF or EWIF file
...@@ -245,7 +247,7 @@ sec: {base58_signing_key}" ...@@ -245,7 +247,7 @@ sec: {base58_signing_key}"
@staticmethod @staticmethod
def from_wif_or_ewif_hex( def from_wif_or_ewif_hex(
wif_hex: str, password: Optional[str] = None wif_hex: str, password: Optional[str] = None
) -> SigningKeyType: ) -> Type[SigningKeyType]:
""" """
Return SigningKey instance from Duniter WIF or EWIF in hexadecimal format Return SigningKey instance from Duniter WIF or EWIF in hexadecimal format
...@@ -266,7 +268,7 @@ sec: {base58_signing_key}" ...@@ -266,7 +268,7 @@ sec: {base58_signing_key}"
return result return result
@staticmethod @staticmethod
def from_wif_file(path: str) -> SigningKeyType: def from_wif_file(path: str) -> Type[SigningKeyType]:
""" """
Return SigningKey instance from Duniter WIF file Return SigningKey instance from Duniter WIF file
...@@ -340,7 +342,7 @@ Data: {wif_key}" ...@@ -340,7 +342,7 @@ Data: {wif_key}"
fh.write(content) fh.write(content)
@staticmethod @staticmethod
def from_ewif_file(path: str, password: str) -> SigningKeyType: def from_ewif_file(path: str, password: str) -> Type[SigningKeyType]:
""" """
Return SigningKey instance from Duniter EWIF file Return SigningKey instance from Duniter EWIF file
...@@ -498,7 +500,7 @@ Data: {ewif_key}" ...@@ -498,7 +500,7 @@ Data: {ewif_key}"
@classmethod @classmethod
def from_dubp_mnemonic( def from_dubp_mnemonic(
cls, mnemonic: str, scrypt_params: ScryptParams = None cls: Type[SigningKeyType], mnemonic: str, scrypt_params: ScryptParams = None
) -> SigningKeyType: ) -> SigningKeyType:
""" """
Generate key pair instance from a DUBP mnemonic passphrase Generate key pair instance from a DUBP mnemonic passphrase
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment