From 025c433b98d03581eab5a6622bc94aa1e8350848 Mon Sep 17 00:00:00 2001 From: Theo BABILON <70515951+TheoBabilon@users.noreply.github.com> Date: Sun, 20 Nov 2022 20:44:22 +0100 Subject: [PATCH] Switch flake8->ruff (#212) * Switch flake8->ruff * Run pip-compile on 3.10 --- Makefile | 4 +++- pyproject.toml | 5 +++++ requirements/linting.in | 3 +-- requirements/linting.txt | 14 ++------------ 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index c8bf0d8c..da5f01d7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ .DEFAULT_GOAL := all isort = isort watchfiles tests black = black watchfiles tests +ruff = ruff watchfiles tests .PHONY: install install: @@ -19,6 +20,7 @@ build-dev: .PHONY: format format: + $(ruff) --fix $(isort) $(black) @echo 'max_width = 120' > .rustfmt.toml @@ -26,7 +28,7 @@ format: .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 diff --git a/pyproject.toml b/pyproject.toml index cf923a10..5468aaa0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 diff --git a/requirements/linting.in b/requirements/linting.in index 0e7a0d88..6193197e 100644 --- a/requirements/linting.in +++ b/requirements/linting.in @@ -1,6 +1,5 @@ black -flake8 -flake8-quotes isort[colors] mypy +ruff trio diff --git a/requirements/linting.txt b/requirements/linting.txt index 1ee6d8b9..32c89fd0 100644 --- a/requirements/linting.txt +++ b/requirements/linting.txt @@ -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 @@ -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