Skip to content

Commit

Permalink
Use ruff instead of flake8 + isort
Browse files Browse the repository at this point in the history
Ruff is more complete and performant
  • Loading branch information
pablogsal committed Jun 26, 2023
1 parent ad9b759 commit 8fd5a43
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 11 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down Expand Up @@ -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"]}
4 changes: 0 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,3 @@ extras =
test
commands =
python -c 'import sys; print(sys.executable)'

[flake8]
max-line-length = 95
ignore = E501, W503

0 comments on commit 8fd5a43

Please sign in to comment.