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

Fixes for ruff 0.2.0 #101

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading