Enable ISC in flake8 and ruff

This commit is contained in:
Alexander Hess 2026-11-30 21:09:05 +01:00
commit 0cb924b3b6
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
5 changed files with 21 additions and 4 deletions

View file

@ -200,6 +200,7 @@ def lint_code(session: nox.Session) -> None:
"flake8-comprehensions",
"flake8-debugger",
"flake8-docstrings",
"flake8-implicit-str-concat",
"flake8-pyproject",
"flake8-pytest-style",
"flake8-quotes",

View file

@ -100,6 +100,7 @@ dev = [
"flake8-comprehensions (>=3.17.0,<4.0.0)",
"flake8-debugger (>=4.1.2,<5.0.0)",
"flake8-docstrings (>=1.7.0,<2.0.0)",
"flake8-implicit-str-concat (>=0.7.0,<0.8.0)",
"flake8-pyproject (>=1.2.4,<2.0.0)",
"flake8-pytest-style (>=2.2.0,<3.0.0)",
"flake8-quotes (>=3.4.0,<4.0.0)",
@ -219,6 +220,8 @@ select = [
"T100",
# flake8-docstrings => PEP257 compliance
"D1", "D2", "D3", "D4",
# flake8-implicit-str-concat => Unified string concatenation
"ISC",
# flake8-pytest-style => enforce a consistent style with pytest
"PT0",
# flake8-quotes => use double quotes everywhere (complying with black)
@ -481,6 +484,8 @@ select = [
"E", "W",
# pyflakes => basic errors
"F",
# flake8-implicit-str-concat => Unified string concatenation
"ISC",
# pep8-naming => PEP8 naming conventions
"N",
# flake8-pytest-style => enforce a consistent style with pytest

View file

@ -90,8 +90,8 @@ def tactical_heuristic( # noqa:C901,D417,DOC001
click.echo(
"Parameters: "
+ f"city={city}, grid.side_length={side_length}, "
+ f"time_step={time_step}, train_horizon={train_horizon}",
f"city={city}, grid.side_length={side_length}, "
f"time_step={time_step}, train_horizon={train_horizon}",
)
# Load the historic order data.
@ -132,7 +132,7 @@ def tactical_heuristic( # noqa:C901,D417,DOC001
)
click.echo(
f"Predicting pixel #{pixel.id} in {city} "
+ f"for {predict_day} with {model.name}",
f"for {predict_day} with {model.name}",
)
# Only loop over the time steps corresponding to working hours.

View file

@ -104,7 +104,7 @@ def stl( # noqa:C901,PLR0912,PLR0913,PLR0915
if nt % 2 == 0 or nt < default_nt:
raise ValueError(
"`nt` must be odd and `>= (1.5 * frequency) / [1 - (1.5 / ns)]`, "
+ f"which is {default_nt}",
f"which is {default_nt}",
)
else:
nt = default_nt

11
uv.lock generated
View file

@ -997,6 +997,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/3f/7d/76a278fa43250441ed9300c344f889c7fb1817080c8fb8996b840bf421c2/flake8_docstrings-1.7.0-py2.py3-none-any.whl", hash = "sha256:51f2344026da083fc084166a9353f5082b01f72901df422f74b4d953ae88ac75", size = 4994, upload-time = "2023-01-25T14:27:12.32Z" },
]
[[package]]
name = "flake8-implicit-str-concat"
version = "0.7.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/b0/83/cb6050d37bd7bcf01dc81ac20d3db96ffc41aca7f73f81fbf61223d5aa03/flake8_implicit_str_concat-0.7.0.tar.gz", hash = "sha256:492d6d1097ec51ca9e712bef9c5b2e8345867dfa8c744a12bf4ef014fdb18561", size = 9876, upload-time = "2026-07-24T12:15:18.04Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/f8/3a/f4906c442afbfea281d7e03322c1761670dca950a4ef4abf1cab218fbc96/flake8_implicit_str_concat-0.7.0-py3-none-any.whl", hash = "sha256:fdabd6c6a314678364053b4a8682495692a43c22f229358e801f711999340d8b", size = 5998, upload-time = "2026-07-24T12:15:16.906Z" },
]
[[package]]
name = "flake8-plugin-utils"
version = "1.3.3"
@ -3811,6 +3820,7 @@ dev = [
{ name = "flake8-comprehensions" },
{ name = "flake8-debugger" },
{ name = "flake8-docstrings" },
{ name = "flake8-implicit-str-concat" },
{ name = "flake8-pyproject" },
{ name = "flake8-pytest-style" },
{ name = "flake8-quotes" },
@ -3879,6 +3889,7 @@ dev = [
{ name = "flake8-comprehensions", specifier = ">=3.17.0,<4.0.0" },
{ name = "flake8-debugger", specifier = ">=4.1.2,<5.0.0" },
{ name = "flake8-docstrings", specifier = ">=1.7.0,<2.0.0" },
{ name = "flake8-implicit-str-concat", specifier = ">=0.7.0,<0.8.0" },
{ name = "flake8-pyproject", specifier = ">=1.2.4,<2.0.0" },
{ name = "flake8-pytest-style", specifier = ">=2.2.0,<3.0.0" },
{ name = "flake8-quotes", specifier = ">=3.4.0,<4.0.0" },