From 8fd5a43822fa1e916679eda0afd5b468eb0588c2 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Fri, 23 Jun 2023 14:24:46 +0100 Subject: [PATCH] Use ruff instead of flake8 + isort Ruff is more complete and performant --- Makefile | 5 ++--- pyproject.toml | 12 +++++++++++- tox.ini | 4 ---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 880ea57..e1a46cb 100644 --- a/Makefile +++ b/Makefile @@ -40,13 +40,12 @@ coverage: ## Run the test suite, with Python code coverage .PHONY: format format: ## Autoformat all files - $(PYTHON) -m isort $(python_files) + $(PYTHON) -m ruff --fix $(python_files) $(PYTHON) -m black $(python_files) .PHONY: lint lint: ## Lint all files - $(PYTHON) -m isort --check $(python_files) - $(PYTHON) -m flake8 $(python_files) + $(PYTHON) -m ruff check $(python_files) $(PYTHON) -m black --check --diff $(python_files) $(PYTHON) -m mypy src/pytest_memray --ignore-missing-imports diff --git a/pyproject.toml b/pyproject.toml index 9db46c0..8708c3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ optional-dependencies.docs = [ ] optional-dependencies.lint = [ "black==22.12", - "flake8==6", + "ruff==0.0.272", "isort==5.11.4", "mypy==0.991", ] @@ -114,3 +114,13 @@ type = [ { name = "Improved Documentation", directory = "doc", showcontent = true }, { name = "Miscellaneous", directory = "misc", showcontent = true }, ] + +[tool.ruff] +ignore = ['E501'] +line-length = 95 +select = [ + 'E', + 'F', + 'W', +] +isort = {known-first-party = ["pytest_memray"], required-imports = ["from __future__ import annotations"]} diff --git a/tox.ini b/tox.ini index e41e2c8..0cc752b 100644 --- a/tox.ini +++ b/tox.ini @@ -77,7 +77,3 @@ extras = test commands = python -c 'import sys; print(sys.executable)' - -[flake8] -max-line-length = 95 -ignore = E501, W503