Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ruff format #831

Merged
merged 12 commits into from
Dec 4, 2023
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,16 @@ exclude = [
"httpcore/_sync",
"tests/_sync",
]
line-length = 120
line-length = 88
select = [
"E",
"F",
"W",
"I"
]

[tool.ruff.pycodestyle]
max-line-length = 120
karpetrosyan marked this conversation as resolved.
Show resolved Hide resolved

tomchristie marked this conversation as resolved.
Show resolved Hide resolved
[tool.ruff.isort]
combine-as-imports = true
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ build==1.0.3
twine

# Tests & Linting
black==23.10.1
coverage[toml]==7.3.0
ruff==0.1.3
mypy==1.5.1
Expand Down
2 changes: 1 addition & 1 deletion scripts/check
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export SOURCE_FILES="httpcore tests"
set -x

${PREFIX}ruff check --show-source $SOURCE_FILES
${PREFIX}black --exclude '/(_sync|sync_tests)/' --check --diff $SOURCE_FILES
${PREFIX}ruff format $SOURCE_FILES --diff
${PREFIX}mypy $SOURCE_FILES
scripts/unasync --check
2 changes: 1 addition & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export SOURCE_FILES="httpcore tests"
set -x

${PREFIX}ruff --fix $SOURCE_FILES
${PREFIX}black --exclude '/(_sync|sync_tests)/' $SOURCE_FILES
${PREFIX}ruff format $SOURCE_FILES

# Run unasync last because its `--check` mode is not aware of code formatters.
# (This means sync code isn't prettified, and that's mostly okay.)
Expand Down