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 <[email protected]>
  • Loading branch information
jfcherng committed Feb 2, 2024
1 parent 32f02f4 commit 9b25a1c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 30 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 .
29 changes: 6 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,6 @@ module = ["plugin.libs.*"]
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 @@ -43,18 +25,15 @@ pythonVersion = '3.8'

[tool.ruff]
preview = true
select = ["E", "F", "W", "I", "UP"]
ignore = ["E203"]
line-length = 120
target-version = 'py38'
exclude = [
"*/libs/*",
".git",
".mypy_cache",
".venv",
".venv-*",
"branch-*",
"libs",
"plugin/libs",
"stubs",
"tests/files",
"typings",
Expand All @@ -63,5 +42,9 @@ exclude = [
"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 9b25a1c

Please sign in to comment.