diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 90ae8da1db13c9e91c98d11e5c682009568beb52..7178b92de6275f0a4b314460c006b37e5a99cb95 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,14 +56,6 @@ build: paths: - ${PRE_COMMIT_HOME} -black: - extends: - - .code_changes - - .pre-commit - stage: checks - script: - - pre-commit run -a black - mypy: extends: - .code_changes @@ -95,6 +87,7 @@ ruff: stage: checks script: - pre-commit run -a ruff + - pre-commit run -a ruff-format .tests: extends: .changes diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7497ee95edd016e4dd1e4691c2f19a6590737b27..7748456d1b63283b913e79f000a60fb7c58468fc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,10 +15,7 @@ repos: hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] -- repo: https://github.com/psf/black - rev: 24.10.0 - hooks: - - id: black + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.14.1 hooks: diff --git a/docs/contributing/index.md b/docs/contributing/index.md index 0bf5385c7ba5189965dda82824edba5857ab3f1f..c8e03cd17efbd176fa355ec62ad859a89ddaace1 100644 --- a/docs/contributing/index.md +++ b/docs/contributing/index.md @@ -88,10 +88,10 @@ In case you want to commit while the hooks are failing, run the following to [sk git commit -m "msg" --no-verify/-n ``` -To manually run one of the tool above, run (eg for `black`): +To manually run one of the tool above, run (eg for `ruff-format`): ```bash -pre-commit run --all-files black +pre-commit run --all-files ruff-format ``` To run all checks on all files: diff --git a/pyproject.toml b/pyproject.toml index 86fc39dcacb4bb98a02aef05cf3ab0d9d690b048..60e4edd63e394d20ba033eaa29e683fdfe19c823 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,7 +58,6 @@ classifiers = [ ignore_missing_imports = true [tool.ruff] -line-length = 101 target-version = "py39" lint.select = ["F", "W", "I", "UP", "YTT", "B", "A", "DTZ", "T10", "EXE", "ISC", "ICN", "G", "INP", "PIE", "PYI", "Q", "RSE", "SLF", "TID", "PL", diff --git a/tests/unit/test_public_key.py b/tests/unit/test_public_key.py index e90b8bd905b805a6c7d50bf6b1997301bf2dd4d7..46fcdeb469a3a8dc44aec54dd320814d7d82d266 100644 --- a/tests/unit/test_public_key.py +++ b/tests/unit/test_public_key.py @@ -127,7 +127,10 @@ def test_gen_pubkey_checksum(pubkey, checksum): assert f"{pubkey}:{checksum}" == public_key.gen_pubkey_checksum(pubkey) assert ( f"{pubkey[:SHORT_PUBKEY_SIZE]}…:{checksum}" - == public_key.gen_pubkey_checksum(pubkey, short=True) + == public_key.gen_pubkey_checksum( + pubkey, + short=True, + ) ) assert f"{pubkey[:14]}…:{checksum}" == public_key.gen_pubkey_checksum( pubkey, diff --git a/tests/unit/wot/test_idty_tools.py b/tests/unit/wot/test_idty_tools.py index 446bd4824e8b92e91cde618a5bd88ac5a0feae4a..4451994b0e8ee54ae12961352e6e5c98897b2b23 100644 --- a/tests/unit/wot/test_idty_tools.py +++ b/tests/unit/wot/test_idty_tools.py @@ -107,7 +107,8 @@ def test_display_alternate_ids(): id_claudius_maximus, ] - expected = "+------------------+--------------------------------------------+--------------+\n\ + expected = ( + "+------------------+--------------------------------------------+--------------+\n\ | uid | public key | timestamp |\n\ +==================+============================================+==============+\n\ | moul-test | 5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1X | 167750-0000A |\n\ @@ -119,6 +120,7 @@ def test_display_alternate_ids(): | Claudius Maximus | 6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj | 7334-002A45E |\n\ | | 7o:7xo | |\n\ +------------------+--------------------------------------------+--------------+" + ) table = idty_tools.display_alternate_ids(ids_list) assert expected == table.draw()