Skip to content

Commit

Permalink
chore: replace autoflake/flake8/isort 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 Nov 18, 2023
1 parent f2bf709 commit 5d1ef7e
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
python-version: ['3.8']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ Thumbs.db
# Python
*.py[cod]
.mypy_cache/
.ruff_cache/
.venv-*/
.venv/
__pycache__/
venv-*/
venv/

# git worktrees
br-*/
Expand Down
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
.PHONY: all
all:

.PHONY: install
install:
python -m pip install -U pip -r requirements.txt

.PHONY: ci-check
ci-check:
mypy -p plugin
flake8 .
black --check --preview --diff .
isort --check --diff .
ruff check --diff --preview .
black --diff --preview --check .

.PHONY: ci-fix
ci-fix:
autoflake --in-place .
ruff check --preview --fix .
# ruff format --preview .
black --preview .
isort .
44 changes: 21 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,6 @@ module = [
ignore_errors = true
ignore_missing_imports = true

[tool.isort]
line_length = 120
profile = 'black'
py_version=38
skip_glob = [
".venv/**",
"br-*/**",
"branch-*/**",
"libs/**",
"plugin/libs/**",
"stubs/**",
"typings/**",
"vendor/**",
"venv/**",
]

[tool.autoflake]
quiet = true
recursive = true
remove-all-unused-imports = true
exclude = '\.git,\.?venv,\.mypy_cache,br-.*,branch-.*,libs,stubs,tests/files,typings'

[tool.black]
preview = true
line-length = 120
Expand Down Expand Up @@ -69,6 +47,26 @@ stubPath = 'typings'
pythonVersion = '3.8'

[tool.ruff]
select = ["E", "F", "W"]
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-*",
]

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

requests

# ----- #
# stubs #
# ----- #

types-requests

# ------------ #
# coding style #
# ------------ #

autoflake
black
flake8
isort
mypy
ruff
16 changes: 0 additions & 16 deletions tox.ini

This file was deleted.

0 comments on commit 5d1ef7e

Please sign in to comment.