Skip to content

Commit

Permalink
chore: replace black with ruff
Browse files Browse the repository at this point in the history
Signed-off-by: Jun-Fei Cherng <[email protected]>
  • Loading branch information
jfcherng committed Feb 15, 2024
1 parent d670e0f commit 8b32cac
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 49 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 .
61 changes: 19 additions & 42 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,10 @@ strict_optional = true
mypy_path = 'typings:stubs'

[[tool.mypy.overrides]]
module = [
"plugin.libs.*",
]
module = ["plugin.libs.*"]
ignore_errors = true
ignore_missing_imports = true

[tool.black]
line-length = 120
target-version = ['py38']

# regex
exclude = '''
/(
\.git
| \.?venv
| \.mypy_cache
| br-*
| branch-*
| libs
| stubs
| tests/files
| typings
)/
'''

[tool.pyright]
include = ['./']
exclude = [
Expand All @@ -40,34 +19,32 @@ exclude = [
'**/br-*/',
'**/branch-*/',
]
ignore = [
'**/.venv',
'**/libs',
]
ignore = ['**/.venv', '**/libs']
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 8b32cac

Please sign in to comment.