Skip to content

Commit 8eff6eb

Browse files
fix ruff configuration
1 parent af021b3 commit 8eff6eb

File tree

3 files changed

+29
-28
lines changed

3 files changed

+29
-28
lines changed

ariadne_codegen/client_generators/package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def _validate_unique_file_names(self):
253253
if len(file_names) != len(set(file_names)):
254254
seen = set()
255255
duplicated_files = {n for n in file_names if n in seen or seen.add(n)}
256-
raise ParsingError(f"Duplicated file names: {',' .join(duplicated_files)}")
256+
raise ParsingError(f"Duplicated file names: {','.join(duplicated_files)}")
257257

258258
def _generate_client(self):
259259
client_file_path = self.package_path / f"{self.client_file_name}.py"

pyproject.toml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ classifiers = [
2525
"Topic :: Software Development :: Libraries :: Python Modules",
2626
]
2727
dependencies = [
28-
"click~=8.1",
28+
"click~=8.2",
2929
"graphql-core>=3.2.0,<3.3",
3030
"toml~=0.10",
3131
"httpx~=0.23",
@@ -77,21 +77,24 @@ features = ["dev", "types"]
7777

7878
[tool.hatch.envs.default.scripts]
7979
check = [
80-
"hatch fmt",
81-
"hatch test -a -p",
82-
"hatch test --cover",
83-
"hatch run types:check",
80+
"hatch fmt",
81+
"hatch test -a -p",
82+
"hatch test --cover",
83+
"hatch run types:check",
8484
]
8585

8686
## Types environment
8787

8888
[tool.hatch.envs.types.scripts]
8989
check = [
90-
"mypy tests/main/clients/*/expected_client",
91-
"mypy tests/main/graphql_schemas/*/expected_schema.py",
92-
"mypy ariadne_codegen/client_generators/dependencies",
90+
"mypy tests/main/clients/*/expected_client",
91+
"mypy tests/main/graphql_schemas/*/expected_schema.py",
92+
"mypy ariadne_codegen/client_generators/dependencies",
9393
]
9494

95+
[tool.hatch.envs.hatch-static-analysis]
96+
dependencies = ["ruff>=0.14.0,<0.15.0"]
97+
9598
## Test environments
9699

97100
[tool.hatch.envs.hatch-test]
@@ -123,16 +126,16 @@ source = ["ariadne_codegen", "tests"]
123126

124127
[tool.coverage.report]
125128
exclude_also = [
126-
"def __repr__",
127-
"if self.debug:",
128-
"if settings.DEBUG",
129-
"raise AssertionError",
130-
"raise NotImplementedError",
131-
"if 0:",
132-
"if __name__ == .__main__.:",
133-
"if TYPE_CHECKING:",
134-
"class .*\\bProtocol\\):",
135-
"@(abc\\.)?abstractmethod",
129+
"def __repr__",
130+
"if self.debug:",
131+
"if settings.DEBUG",
132+
"raise AssertionError",
133+
"raise NotImplementedError",
134+
"if 0:",
135+
"if __name__ == .__main__.:",
136+
"if TYPE_CHECKING:",
137+
"class .*\\bProtocol\\):",
138+
"@(abc\\.)?abstractmethod",
136139
]
137140
omit = ["*/__about__.py", "*/__main__.py", "*/cli/__init__.py"]
138141
fail_under = 90
@@ -146,9 +149,7 @@ target-version = "py39"
146149
[tool.ruff.format]
147150
docstring-code-format = true
148151
docstring-code-line-length = 99
149-
exclude = [
150-
"tests/main/clients/*/expected_client/*"
151-
]
152+
exclude = ["tests/main/clients/*/expected_client/*"]
152153

153154
[tool.ruff.lint]
154155
select = ["E", "F", "G", "I", "N", "Q", "UP", "C90", "T20", "TID"]

tests/client_generators/result_types_generator/test_include_typename.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,9 @@ def test_union_discriminator_respects_include_typename():
276276
break
277277

278278
# Assertions
279-
assert (
280-
has_discriminator_with_typename
281-
), "Expected discriminator when include_typename=True"
282-
assert (
283-
not has_discriminator_without_typename
284-
), "Should not have discriminator when include_typename=False"
279+
assert has_discriminator_with_typename, (
280+
"Expected discriminator when include_typename=True"
281+
)
282+
assert not has_discriminator_without_typename, (
283+
"Should not have discriminator when include_typename=False"
284+
)

0 commit comments

Comments
 (0)