Skip to content

Commit

Permalink
Use ruff format (#2901)
Browse files Browse the repository at this point in the history
  • Loading branch information
karpetrosyan committed Nov 2, 2023
1 parent 05937f4 commit 1b7f39e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion httpx/_transports/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
def map_httpcore_exceptions() -> typing.Iterator[None]:
try:
yield
except Exception as exc: # noqa: PIE-786
except Exception as exc:
mapped_exc = None

for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ replacement = 'src="https://raw.githubusercontent.com/encode/httpx/master/\1"'
[tool.ruff]
select = ["E", "F", "I", "B", "PIE"]
ignore = ["B904", "B028"]
line-length = 120
line-length = 88

[tool.ruff.pycodestyle]
max-line-length = 120

[tool.ruff.isort]
combine-as-imports = true
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ build==0.10.0
twine==4.0.2

# Tests & Linting
black==23.9.1
coverage[toml]==7.3.0
cryptography==41.0.4
mypy==1.5.1
types-certifi==2021.10.8.2
pytest==7.4.3
ruff==0.0.291
ruff==0.1.3
trio==0.22.2
trio-typing==0.9.0
trustme==1.1.0
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="httpx tests"
set -x

./scripts/sync-version
${PREFIX}black --check --diff $SOURCE_FILES
${PREFIX}ruff format $SOURCE_FILES --diff
${PREFIX}mypy $SOURCE_FILES
${PREFIX}ruff check $SOURCE_FILES
2 changes: 1 addition & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export SOURCE_FILES="httpx tests"
set -x

${PREFIX}ruff --fix $SOURCE_FILES
${PREFIX}black $SOURCE_FILES
${PREFIX}ruff format $SOURCE_FILES

0 comments on commit 1b7f39e

Please sign in to comment.