Skip to content

Commit

Permalink
chore: replace black with ruff
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
  • Loading branch information
jfcherng committed Feb 2, 2024
1 parent a7f1656 commit 2c82a55
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 41 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ install:

.PHONY: ci-check
ci-check:
@echo "========== check: mypy =========="
mypy -p plugin
ruff check --diff --preview .
black --diff --preview --check .
@echo "========== check: ruff (lint) =========="
ruff check --diff .
@echo "========== check: ruff (format) =========="
ruff format --diff .

.PHONY: ci-fix
ci-fix:
ruff check --preview --fix .
# ruff format --preview .
black --preview .
@echo "========== fix: ruff (lint) =========="
ruff check --fix .
@echo "========== fix: ruff (format) =========="
ruff format .
52 changes: 18 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,6 @@ module = [
ignore_errors = true
ignore_missing_imports = true

[tool.black]
preview = true
line-length = 120
target-version = ['py38']
exclude = '''
/(
\.git
| \.?venv
| \.mypy_cache
| br-.*
| branch-.*
| libs
| stubs
| tests/files
| typings
)/
'''

[tool.pyright]
include = ['./']
exclude = [
Expand All @@ -46,27 +28,29 @@ ignore = [
stubPath = 'typings'
pythonVersion = '3.8'


[tool.ruff]
preview = true
select = ["E", "F", "W", "I", "UP"]
ignore = ["E203"]
line-length = 120
target-version = 'py38'
exclude = [
".git",
".mypy_cache",
".venv",
".venv-*",
"branch-*",
"libs",
"plugin/libs",
"stubs",
"tests/files",
"typings",
"vendor",
"venv",
"venv-*",
"*/libs/*",
".git",
".mypy_cache",
".venv",
".venv-*",
"branch-*",
"stubs",
"tests/files",
"typings",
"vendor",
"venv",
"venv-*",
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP"]
ignore = ["E203"]

[tool.ruff.lint.per-file-ignores]
"boot.py" = ["E402"]
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This is an implicit value, here for clarity
--index https://pypi.python.org/simple/

black
mypy
ruff
ruff>=0.2

0 comments on commit 2c82a55

Please sign in to comment.