Skip to content

Commit

Permalink
Drop flake8/isort, add ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelhwilliams committed May 4, 2023
1 parent d183858 commit 9cfd31c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
13 changes: 4 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.261'
hooks:
- id: flake8
name: flake8 (python)
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ build: bootstrap ## Build project (dummy task for CI)

.PHONY: test
test: ## Run tests
flake8 .
isort --check-only ./notifications_python_client ./utils ./integration_test ./tests
ruff check .
black --check .
pytest

Expand Down
22 changes: 20 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
[tool.black]
line-length = 120

[tool.isort]
profile = "black"
[tool.ruff]
line-length = 120

target-version = "py39"

select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C90", # mccabe cyclomatic complexity
]
ignore = []
exclude = [
"venv*",
"__pycache__",
"cache",
"build",
]
4 changes: 1 addition & 3 deletions requirements_for_test.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
.

isort==5.12.0 ; python_version >= '3.8' # Also update `.pre-commit-config.yaml` if this change
isort==5.10.0 ; python_version < '3.8'
flake8>=3.9.2 # Also update `.pre-commit-config.yaml` if this change
pytest>=3.0.2
pytest-mock>=1.2
pytest-cov>=2.3.1
Expand All @@ -13,3 +10,4 @@ requests-mock>=0.7.0
jsonschema>=2.5.1

black==22.8.0 # Also update `.pre-commit-config.yaml` if this changes
ruff==0.0.261 # Also update `.pre-commit-config.yaml` if this changes

0 comments on commit 9cfd31c

Please sign in to comment.