style: format source code using Ruff

This commit is contained in:
jakob.scheid committed 2026-09-21 20:10:04 +02:00
1 parent d9887f34c9
commit aa4a139878
41 files changed
+6061 -5670

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -23,6 +23,7 @@ from src.jcloud_docsgen.exceptions import (
)
import pytest
@pytest.mark.parametrize(
'name,kind,default,annotation,expected_exception,expected_exception_msg',
[
@@ -32,7 +33,7 @@ import pytest
None,
None,
TypeError,
'expected \'str\', got \'NoneType\'',
"expected 'str', got 'NoneType'",
),
(
1,
@@ -40,7 +41,7 @@ import pytest
None,
None,
TypeError,
'expected \'str\', got \'int\'',
"expected 'str', got 'int'",
),
(
42,
@@ -48,7 +49,7 @@ import pytest
None,
None,
TypeError,
'expected \'str\', got \'int\'',
"expected 'str', got 'int'",
),
(
4.2,
@@ -56,7 +57,7 @@ import pytest
None,
None,
TypeError,
'expected \'str\', got \'float\'',
"expected 'str', got 'float'",
),
(
4.2,
@@ -64,7 +65,7 @@ import pytest
None,
None,
TypeError,
'expected \'str\', got \'float\'',
"expected 'str', got 'float'",
),
(
'a',
@@ -72,7 +73,7 @@ import pytest
1,
None,
TypeError,
'expected either \'str\' or \'NoneType\', got \'int\'',
"expected either 'str' or 'NoneType', got 'int'",
),
(
'a',
@@ -80,7 +81,7 @@ import pytest
None,
1,
TypeError,
'expected either \'str\' or \'NoneType\', got \'int\'',
"expected either 'str' or 'NoneType', got 'int'",
),
(
'a',
@@ -88,7 +89,7 @@ import pytest
None,
None,
TypeError,
'expected \'PythonArgumentKind\', got \'int\'',
"expected 'PythonArgumentKind', got 'int'",
),
(
'a',
@@ -384,220 +385,244 @@ def test_PythonFunctionArgument_exceptions(
PythonFunctionArgument(name, kind, default, annotation)
assert str(exc_info.value) == expected_exception_msg
@pytest.mark.parametrize('name', [
'a',
'_a',
'a1',
'a0',
'a_',
'_',
'_abc',
'abc',
'abc_',
'match',
'case',
'type',
'ä',
'none',
'true',
'false',
])
@pytest.mark.parametrize('kind', [
PythonArgumentKind.NORMAL,
PythonArgumentKind.POSITIONAL_ONLY,
PythonArgumentKind.KEYWORD_ONLY,
])
@pytest.mark.parametrize('default', [
None,
'x',
'1',
None,
])
@pytest.mark.parametrize('annotation', [
None,
'a',
'list[int]',
'_',
])
@pytest.mark.parametrize(
'name',
[
'a',
'_a',
'a1',
'a0',
'a_',
'_',
'_abc',
'abc',
'abc_',
'match',
'case',
'type',
'ä',
'none',
'true',
'false',
],
)
@pytest.mark.parametrize(
'kind',
[
PythonArgumentKind.NORMAL,
PythonArgumentKind.POSITIONAL_ONLY,
PythonArgumentKind.KEYWORD_ONLY,
],
)
@pytest.mark.parametrize(
'default',
[
None,
'x',
'1',
None,
],
)
@pytest.mark.parametrize(
'annotation',
[
None,
'a',
'list[int]',
'_',
],
)
def test_PythonFunctionArgument(name, kind, default, annotation):
PythonFunctionArgument(name, kind, default, annotation)
@pytest.mark.parametrize('name', [
'a',
'_a',
'a1',
'a0',
'a_',
'_',
'_abc',
'abc',
'abc_',
'match',
'case',
'type',
'ä',
'none',
'true',
'false',
])
@pytest.mark.parametrize('kind', [
PythonArgumentKind.VARARG,
PythonArgumentKind.KWARGS,
])
@pytest.mark.parametrize('annotation', [
None,
'a',
'list[int]',
'_',
])
@pytest.mark.parametrize(
'name',
[
'a',
'_a',
'a1',
'a0',
'a_',
'_',
'_abc',
'abc',
'abc_',
'match',
'case',
'type',
'ä',
'none',
'true',
'false',
],
)
@pytest.mark.parametrize(
'kind',
[
PythonArgumentKind.VARARG,
PythonArgumentKind.KWARGS,
],
)
@pytest.mark.parametrize(
'annotation',
[
None,
'a',
'list[int]',
'_',
],
)
def test_PythonFunctionArgument_asterik(name, kind, annotation):
PythonFunctionArgument(name, kind, None, annotation)
@pytest.mark.parametrize('argument,expected', [
(
PythonFunctionArgument(
@pytest.mark.parametrize(
'argument,expected',
[
(
PythonFunctionArgument(
'a',
PythonArgumentKind.NORMAL,
None,
None,
),
'a',
PythonArgumentKind.NORMAL,
None,
None,
),
'a',
),
(
PythonFunctionArgument(
(
PythonFunctionArgument(
'a',
PythonArgumentKind.NORMAL,
'1',
None,
),
'a = 1',
),
(
PythonFunctionArgument(
'a', PythonArgumentKind.NORMAL, None, 'int'
),
'a: int',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.NORMAL,
'1',
'int',
),
'a: int = 1',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.POSITIONAL_ONLY,
None,
None,
),
'a',
PythonArgumentKind.NORMAL,
'1',
None,
),
'a = 1',
),
(
PythonFunctionArgument(
(
PythonFunctionArgument(
'a',
PythonArgumentKind.POSITIONAL_ONLY,
'1',
None,
),
'a = 1',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.POSITIONAL_ONLY,
None,
'int',
),
'a: int',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.POSITIONAL_ONLY,
'1',
'int',
),
'a: int = 1',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KEYWORD_ONLY,
None,
None,
),
'a',
PythonArgumentKind.NORMAL,
None,
'int'
),
'a: int',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.NORMAL,
'1',
'int',
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KEYWORD_ONLY,
'1',
None,
),
'a = 1',
),
'a: int = 1',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.POSITIONAL_ONLY,
None,
None,
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KEYWORD_ONLY,
None,
'int',
),
'a: int',
),
'a',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.POSITIONAL_ONLY,
'1',
None,
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KEYWORD_ONLY,
'1',
'int',
),
'a: int = 1',
),
'a = 1',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.POSITIONAL_ONLY,
None,
'int',
(
PythonFunctionArgument(
'a',
PythonArgumentKind.VARARG,
None,
None,
),
'*a',
),
'a: int',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.POSITIONAL_ONLY,
'1',
'int',
(
PythonFunctionArgument(
'a',
PythonArgumentKind.VARARG,
None,
'int',
),
'*a: int',
),
'a: int = 1',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KEYWORD_ONLY,
None,
None,
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KWARGS,
None,
None,
),
'**a',
),
'a',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KEYWORD_ONLY,
'1',
None,
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KWARGS,
None,
'int',
),
'**a: int',
),
'a = 1',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KEYWORD_ONLY,
None,
'int',
),
'a: int',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KEYWORD_ONLY,
'1',
'int',
),
'a: int = 1',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.VARARG,
None,
None,
),
'*a',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.VARARG,
None,
'int',
),
'*a: int',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KWARGS,
None,
None,
),
'**a',
),
(
PythonFunctionArgument(
'a',
PythonArgumentKind.KWARGS,
None,
'int',
),
'**a: int',
),
])
],
)
def test_PythonFunctionArgument_signature_repr(argument, expected):
assert argument.signature_repr() == expected