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 <[email protected]>
  • Loading branch information
jfcherng committed Nov 16, 2023
1 parent b3d7568 commit 5a1c63f
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 38 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,4 @@ jobs:
- name: Do linting
run: |
mypy -p plugin
flake8 plugin
black --check plugin
make ci-check
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020-2022 Jack Cherng <jfcherng.gmail.com>
Copyright (c) 2020-2023 Jack Cherng <jfcherng.gmail.com>
Copyright (c) 2014 Jonathan Delgado

Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +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
ruff check --diff --preview .
black --diff --preview --check .

.PHONY: ci-fix
ci-fix:
ruff check --preview --fix .
# ruff format --preview .
black --preview .
41 changes: 25 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@ module = [
ignore_errors = true
ignore_missing_imports = true

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

[tool.black]
line-length = 120
target-version = ['py38']
Expand Down Expand Up @@ -62,3 +46,28 @@ ignore = [
]
stubPath = 'typings'
pythonVersion = '3.8'

[tool.ruff]
preview = true
select = ["E", "F", "W", "I"]
ignore = ["E203"]
line-length = 120
target-version = 'py312'
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"]
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
--index https://pypi.python.org/simple/

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

This file was deleted.

0 comments on commit 5a1c63f

Please sign in to comment.