Skip to content

Commit

Permalink
Fixes for ruff 0.2.0 (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbede committed Feb 5, 2024
1 parent 0dfabdf commit e95b258
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aioelectricitymaps/electricitymaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def _get(self, url: str, params: dict[str, Any] | None = None) -> str:
params=params,
)
response.raise_for_status()
except asyncio.TimeoutError as exception:
except TimeoutError as exception:
msg = "Timeout occurred while connecting to the Electricity Maps API"
raise ElectricityMapsConnectionTimeoutError(msg) from exception
except (
Expand Down
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ addopts = "--cov"
asyncio_mode = "auto"

[tool.ruff]
target-version = "py311"

[tool.ruff.lint]
ignore = [
"ANN101", # Self... explanatory
"ANN102", # cls... just as useless
Expand All @@ -141,17 +144,17 @@ ignore = [
]
select = ["ALL"]

[tool.ruff.flake8-pytest-style]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["aioelectricitymaps"]
force-sort-within-sections = true
split-on-trailing-comma = false
combine-as-imports = true

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
max-complexity = 25

[build-system]
Expand Down
4 changes: 2 additions & 2 deletions tests/ruff.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# This extend our general Ruff rules specifically for tests
extend = "../pyproject.toml"

extend-select = [
lint.extend-select = [
"PT", # Use @pytest.fixture without parentheses
]

extend-ignore = [
lint.extend-ignore = [
"S101", # Use of assert detected. As these are tests...
"S105", # Detection of passwords...
"S106", # Detection of passwords...
Expand Down

0 comments on commit e95b258

Please sign in to comment.