Skip to content

Commit

Permalink
Switch flake8->ruff (#212)
Browse files Browse the repository at this point in the history
* Switch flake8->ruff

* Run pip-compile on 3.10
  • Loading branch information
TheoBabilon authored Nov 20, 2022
1 parent 014b258 commit 025c433
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DEFAULT_GOAL := all
isort = isort watchfiles tests
black = black watchfiles tests
ruff = ruff watchfiles tests

.PHONY: install
install:
Expand All @@ -19,14 +20,15 @@ build-dev:

.PHONY: format
format:
$(ruff) --fix
$(isort)
$(black)
@echo 'max_width = 120' > .rustfmt.toml
cargo fmt

.PHONY: lint-python
lint-python:
flake8 --max-complexity 10 --max-line-length 120 --ignore E203,W503 watchfiles tests
$(ruff)
$(isort) --check-only --df
$(black) --check --diff

Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ force_grid_wrap = 0
combine_as_imports = true
color_output = true

[tool.ruff]
line-length = 120
extend-select = ['Q']
flake8-quotes = {inline-quotes = 'single', multiline-quotes = 'double'}

[tool.mypy]
strict = true
warn_return_any = false
Expand Down
3 changes: 1 addition & 2 deletions requirements/linting.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
black
flake8
flake8-quotes
isort[colors]
mypy
ruff
trio
14 changes: 2 additions & 12 deletions requirements/linting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,10 @@ click==8.1.3
# via black
colorama==0.4.5
# via isort
flake8==5.0.4
# via
# -r requirements/linting.in
# flake8-quotes
flake8-quotes==3.3.1
# via -r requirements/linting.in
idna==3.3
# via trio
isort[colors]==5.10.1
# via -r requirements/linting.in
mccabe==0.7.0
# via flake8
mypy==0.971
# via -r requirements/linting.in
mypy-extensions==0.4.3
Expand All @@ -38,10 +30,8 @@ pathspec==0.10.1
# via black
platformdirs==2.5.2
# via black
pycodestyle==2.9.1
# via flake8
pyflakes==2.5.0
# via flake8
ruff==0.0.130
# via -r requirements/linting.in
sniffio==1.3.0
# via trio
sortedcontainers==2.4.0
Expand Down

0 comments on commit 025c433

Please sign in to comment.