Skip to content

Commit

Permalink
Replace the formatter tool from black to ruff
Browse files Browse the repository at this point in the history
Signed-off-by: Tsuyoshi Hombashi <[email protected]>
  • Loading branch information
thombashi committed Dec 29, 2024
1 parent 27befea commit 73373fb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,14 @@ show_error_codes = true
show_error_context = true
warn_unreachable = true
warn_unused_configs = true

[tool.ruff]
line-length = 100
target-version = "py39"
exclude = [
".eggs/",
".tox/",
"_sandbox/*",
"build/",
"docs/conf.py",
]
4 changes: 3 additions & 1 deletion test/checker/test_checker_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class Test_Binary_is_type:
["value", "strict_level", "expected"],
list(itertools.product([], [StrictLevel.MIN, StrictLevel.MAX], [False]))
+ list(
itertools.product([b"abc", "いろは".encode()], [StrictLevel.MIN, StrictLevel.MAX], [True])
itertools.product(
[b"abc", "いろは".encode()], [StrictLevel.MIN, StrictLevel.MAX], [True]
)
)
+ list(itertools.product([b" ", b"\n"], [StrictLevel.MIN], [True]))
+ list(
Expand Down
17 changes: 14 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,26 @@ deps =
commands =
sphinx-build docs/ docs/_build

[testenv:fmt]
[testenv:fmt-black]
skip_install = true
deps =
autoflake>=2
black>=23.1
black>=24
isort>=5
commands =
black make_test_cases.py setup.py test typepy
autoflake --in-place --recursive --remove-all-unused-imports --ignore-init-module-imports .
autoflake --in-place --recursive --remove-all-unused-imports .
isort .

[testenv:fmt]
skip_install = true
deps =
autoflake>=2
isort>=5
ruff>=0.8
commands =
ruff format make_test_cases.py setup.py test typepy
autoflake --in-place --recursive --remove-all-unused-imports .
isort .

[testenv:lint]
Expand Down

0 comments on commit 73373fb

Please sign in to comment.