Skip to content

Commit

Permalink
ci!: Add ruff, replacing isort, flake8 and its extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed May 27, 2023
1 parent 9307424 commit 992a49f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 203 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
python -V
poetry run python -V
- name: Lint with flake8
run: poetry run flake8
- name: Lint with ruff
run: poetry run ruff .

- name: Lint with mypy
run: poetry run mypy .
Expand Down
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ entr_warn:
@echo "See https://eradman.com/entrproject/ "
@echo "----------------------------------------------------------"

isort:
poetry run isort `${PY_FILES}`

black:
poetry run black `${PY_FILES}`

Expand All @@ -36,11 +33,11 @@ start_docs:
design_docs:
$(MAKE) -C docs design

flake8:
flake8
ruff:
ruff .

watch_flake8:
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) flake8; else $(MAKE) flake8 entr_warn; fi
watch_ruff:
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) ruff; else $(MAKE) ruff entr_warn; fi

mypy:
poetry run mypy `${PY_FILES}`
Expand Down
211 changes: 28 additions & 183 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 4 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ python = "^3.7"
myst_parser = ">=0.18.1"
docutils = "*"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
### Docs ###
sphinx = "*"
furo = "*"
Expand All @@ -67,19 +67,14 @@ pytest-cov = "*"

### Format ###
black = "*"
isort = "*"

### Lint ###
flake8 = [
{ version = "*", python = "^3.7" },
{ version = ">=5", python = "^3.8" },
]
flake8-bugbear = "*"
flake8-comprehensions = "*"
ruff = "*"
mypy = "*"
typing-extensions = { version = "*", python = "^3.7" }
types-docutils = "*"


[tool.poetry.extras]
docs = [
"sphinx",
Expand All @@ -95,9 +90,7 @@ test = ["pytest", "pytest-rerunfailures", "pytest-watcher"]
coverage = ["codecov", "coverage", "pytest-cov"]
format = ["black", "isort"]
lint = [
"flake8",
"flake8-bugbear",
"flake8-comprehensions",
"ruff",
"mypy",
"types-docutils",
"typing-extensions",
Expand Down

0 comments on commit 992a49f

Please sign in to comment.