Skip to content

Commit

Permalink
Use ruff instead of flake8, autoflake and isort (encode#2110)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex authored Apr 5, 2023
1 parent f7bf741 commit 94b1d70
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@ path = "starlette/__init__.py"
include = [
"/starlette",
]

[tool.ruff]
select = ["E", "F", "I"]

[tool.ruff.isort]
combine-as-imports = true
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
-e .[full]

# Testing
autoflake==1.5.3
black==22.12.0
coverage==7.1.0
flake8==3.9.2
importlib-metadata==4.13.0
isort==5.10.1
mypy==1.0.1
ruff==0.0.260
typing_extensions==4.5.0
types-contextvars==2.4.7.2
types-PyYAML==6.0.12.9
Expand Down
3 changes: 1 addition & 2 deletions scripts/check
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export SOURCE_FILES="starlette tests"
set -x

./scripts/sync-version
${PREFIX}isort --check --diff --project=starlette $SOURCE_FILES
${PREFIX}black --check --diff $SOURCE_FILES
${PREFIX}flake8 $SOURCE_FILES
${PREFIX}mypy $SOURCE_FILES
${PREFIX}ruff --diff $SOURCE_FILES
3 changes: 1 addition & 2 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ export SOURCE_FILES="starlette tests"

set -x

${PREFIX}autoflake --in-place --recursive $SOURCE_FILES
${PREFIX}isort --project=starlette $SOURCE_FILES
${PREFIX}ruff --fix $SOURCE_FILES
${PREFIX}black $SOURCE_FILES
8 changes: 0 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[flake8]
ignore = W503, E203, B305
max-line-length = 88

[mypy]
disallow_untyped_defs = True
ignore_missing_imports = True
Expand All @@ -16,10 +12,6 @@ no_implicit_optional = False
disallow_untyped_defs = False
check_untyped_defs = True

[tool:isort]
profile = black
combine_as_imports = True

[tool:pytest]
addopts =
-rxXs
Expand Down

0 comments on commit 94b1d70

Please sign in to comment.