Skip to content

Commit 78265f4

Browse files
committed
Lint
1 parent 5bccae5 commit 78265f4

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

sphinx_pyproject/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ def __init__(
155155
if key not in pep621_config:
156156
raise BadConfigError(
157157
f"Either {key!r} was not declared in the 'project' table "
158-
f"or it was marked as 'dynamic', which is unsupported by 'sphinx-pyproject'."
158+
"or it was marked as 'dynamic', which is unsupported by 'sphinx-pyproject'.",
159159
)
160160

161161
if "author" not in pep621_config:
162162
raise BadConfigError(
163-
f"Either 'authors/maintainers' was not declared in the 'project' table "
164-
f"or it was marked as 'dynamic', which is unsupported by 'sphinx-pyproject'."
163+
"Either 'authors/maintainers' was not declared in the 'project' table "
164+
"or it was marked as 'dynamic', which is unsupported by 'sphinx-pyproject'.",
165165
)
166166

167167
self.name = pep621_config["name"]
@@ -276,7 +276,7 @@ def parse_author(config: Dict[str, TOML_TYPES]) -> str:
276276
all_authors = list(filter(bool, all_authors))
277277

278278
if not all_authors:
279-
raise BadConfigError(f"The 'project.authors' key cannot be empty.")
279+
raise BadConfigError("The 'project.authors' key cannot be empty.")
280280

281281
return word_join(all_authors) # type: ignore
282282

tests/test_sphinx_pyproject.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,26 @@ def test_parse_our_config(advanced_data_regression: AdvancedDataRegressionFixtur
7373
pytest.param(
7474
f"{MINIMUM}\n[tool.sphinx-pyproject]\ngithub_username = 'username'",
7575
1,
76-
id="github_username"
76+
id="github_username",
7777
),
7878
pytest.param(
7979
f"{MINIMUM}\n[tool.sphinx-pyproject]\ngithub_repository = 'repo'",
8080
1,
81-
id="github_repository"
81+
id="github_repository",
8282
),
8383
pytest.param(f"{MINIMUM}\n[tool.sphinx-pyproject]\nlanguage = 'en'", 1, id="language"),
8484
pytest.param(
85-
f"{MINIMUM}\n[tool.sphinx-pyproject]\nextensions = ['sphinx-toolbox']", 1, id="extensions"
85+
f"{MINIMUM}\n[tool.sphinx-pyproject]\nextensions = ['sphinx-toolbox']",
86+
1,
87+
id="extensions",
8688
),
8789
pytest.param(
8890
f"{MINIMUM}\n[tool.sphinx-pyproject]\nhtml_show_sourcelink = true",
8991
1,
90-
id="html_show_sourcelink"
92+
id="html_show_sourcelink",
9193
),
9294
pytest.param(MULTIPLE_KEYS, 4, id="multiple_keys"),
93-
]
95+
],
9496
)
9597
def test_parse_config(
9698
tmp_pathplus: PathPlus,
@@ -140,9 +142,10 @@ def test_authors_commas(tmp_pathplus: PathPlus):
140142
pytest.param("[project]\nname = 'foo'\ndescription = 'Description'", id="name_description"),
141143
pytest.param("[project]\nname = 'foo'\nversion = '1.2.3'", id="name_description"),
142144
pytest.param(
143-
"[project]\nname = 'foo'\nversion = '1.2.3'\ndescription = 'Description'", id="no_authors"
145+
"[project]\nname = 'foo'\nversion = '1.2.3'\ndescription = 'Description'",
146+
id="no_authors",
144147
),
145-
]
148+
],
146149
)
147150
def test_missing_keys(tmp_pathplus: PathPlus, config: str):
148151
(tmp_pathplus / "pyproject.toml").write_text(config)
@@ -174,10 +177,11 @@ def test_missing_keys(tmp_pathplus: PathPlus, config: str):
174177

175178

176179
@pytest.mark.parametrize(
177-
"toml", [
180+
"toml",
181+
[
178182
pytest.param(POETRY_AUTHORS, id="authors"),
179183
pytest.param(POETRY_MAINTAINERS, id="maintainers"),
180-
]
184+
],
181185
)
182186
def test_poetry(tmp_pathplus: PathPlus, toml: str):
183187
(tmp_pathplus / "pyproject.toml").write_text(toml)

0 commit comments

Comments
 (0)