Skip to content

Commit

Permalink
chore: enable more lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jnicoulaud-ledger committed Sep 13, 2024
1 parent d38ed20 commit 5474224
Show file tree
Hide file tree
Showing 18 changed files with 59 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ changelog:
- documentation # standard github label
- title: Other changes
labels:
- "*"
- "*"
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: continuous integration

on:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
name: release drafter

on:
push:
branches:
- master
pull_request:
types: [ opened, reopened, synchronize ]
types: [opened, reopened, synchronize]

permissions:
contents: read
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: release

on:
Expand Down Expand Up @@ -46,7 +45,7 @@ jobs:

- name: Sign distribution artifacts
timeout-minutes: 10
uses: LedgerHQ/actions-security/actions/sign-blob@actions/sign-blob-1
uses: LedgerHQ/actions-security/actions/sign-blob@actions/sign-blob-1
with:
path: dist

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: update dependencies

on:
Expand Down
84 changes: 42 additions & 42 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,42 @@ repos:
# - pydantic
# - pytest
#
# - repo: https://github.com/pdm-project/pdm
# rev: 2.18.1
# hooks:
# - id: pdm-lock-check
# name: check pdm lock file
#
# - repo: https://github.com/adrienverge/yamllint.git
# rev: v1.29.0
# hooks:
# - id: yamllint
# name: check yaml files (yamllint)
#
# - repo: https://github.com/pre-commit/pre-commit-hooks
# rev: v4.5.0
# hooks:
# - id: check-ast
# - id: check-builtin-literals
# - id: check-case-conflict
# - id: check-docstring-first
# - id: check-executables-have-shebangs
# - id: check-merge-conflict
# - id: check-shebang-scripts-are-executable
# - id: check-symlinks
# - id: check-toml
# - id: check-json
# - id: check-yaml
# - id: check-vcs-permalinks
# - id: debug-statements
# - id: destroyed-symlinks
# - id: detect-private-key
# - id: end-of-file-fixer
# - id: forbid-new-submodules
# - id: mixed-line-ending
# - id: fix-byte-order-marker
# # - id: no-commit-to-branch TODO (temporary for development)
#
- repo: https://github.com/pdm-project/pdm
rev: 2.18.1
hooks:
- id: pdm-lock-check
name: check pdm lock file

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.29.0
hooks:
- id: yamllint
name: check yaml files (yamllint)

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-json
- id: check-yaml
- id: check-vcs-permalinks
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: mixed-line-ending
- id: fix-byte-order-marker
# - id: no-commit-to-branch TODO (temporary for development)

# - repo: https://github.com/asottile/pyupgrade
# rev: v3.15.2
# hooks:
Expand Down Expand Up @@ -122,9 +122,9 @@ repos:
# name: lint docs spelling (codespell)
# additional_dependencies:
# - tomli
#
# - repo: https://github.com/rhysd/actionlint
# rev: v1.6.27
# hooks:
# - id: actionlint
# name: lint Github Actions workflows (actionlint)

- repo: https://github.com/rhysd/actionlint
rev: v1.6.27
hooks:
- id: actionlint
name: lint Github Actions workflows (actionlint)
6 changes: 6 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: default

rules:
document-start: disable
line-length:
max: 120
2 changes: 1 addition & 1 deletion docs/erc-7730.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -749,4 +749,4 @@
]
}
}
}
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ exclude_dirs = ["tests"]

[tool.codespell]
ignore-words = ".codespellignore"
skip = "inputs/*,outputs/*,pdm.lock"
skip = "inputs/*,outputs/*,pdm.lock"
2 changes: 1 addition & 1 deletion src/erc7730/common/pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ def model_from_json_bytes(bytes: bytes, model: type[M]) -> M:
Load a Pydantic model from a JSON file content as an array of bytes.
"""
return model.model_validate_json(bytes, strict=True)


2 changes: 1 addition & 1 deletion src/erc7730/mapper/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ def to_eip712_mapper(erc7730: ERC7730Descriptor) -> EIP712BaseMapper:
return EIP712BaseMapper(chain_id, contract_address, schema, display_name)
else:
raise Exception(f"context for {erc7730} is None or is not EIP712")


2 changes: 1 addition & 1 deletion src/erc7730/model/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
""" Package implementing all typed method and their validations """
""" Package implementing all typed method and their validations """
2 changes: 1 addition & 1 deletion src/erc7730/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class BaseLibraryModel(BaseModel):
validate_assignment=True,
arbitrary_types_allowed=False,
allow_inf_nan=False,
)
)
8 changes: 0 additions & 8 deletions src/erc7730/model/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,3 @@ class EIP712Context(EIP712DomainBinding):











2 changes: 0 additions & 2 deletions src/erc7730/model/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,3 @@ class Field(BaseLibraryModel):
class Display(BaseLibraryModel):
definitions: Optional[Dict[str, Field]] = None
formats: Dict[str, Format]


2 changes: 1 addition & 1 deletion src/erc7730/model/erc7730_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ class ERC7730Descriptor(BaseLibraryModel):
context: Optional[Union[ContractContext, EIP712Context]] = None
includes: Optional[list[Union[AnyUrl, Path]]] = None
metadata: Optional[Metadata] = None
display: Optional[Display] = None
display: Optional[Display] = None
7 changes: 0 additions & 7 deletions src/erc7730/model/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,3 @@ class Metadata(BaseLibraryModel):
token: Optional[TokenInfo] = None
constants: Optional[Dict[str, str]] = None
enums: Optional[Union[AnyUrl, Dict[str, Dict[str, str]]]] = None







2 changes: 1 addition & 1 deletion tests/src/erc7730/test_datamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def test_from_erc7730() -> None:
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/paraswap/calldata-AugustusSwapper.json"), ERC7730Descriptor) is not None
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/tether/calldata-usdt.json"), ERC7730Descriptor) is not None
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/uniswap/calldata-UniswapV3Router02.json"), ERC7730Descriptor) is not None
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/uniswap/eip712-permit2.json"), ERC7730Descriptor) is not None
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/uniswap/eip712-permit2.json"), ERC7730Descriptor) is not None

0 comments on commit 5474224

Please sign in to comment.