Skip to content

Commit 3d83b5d

Browse files
[CI] Check source code with black (#23)
* reformatting (black) * [CI] Source code is checked with black * Code style is fixed (black)
1 parent befcce5 commit 3d83b5d

12 files changed

Lines changed: 51 additions & 21 deletions

File tree

.github/workflows/package-verification.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
python -m pip install flake8 flake8-pyproject ruff
30+
python -m pip install flake8 flake8-pyproject ruff black
3131
- name: Lint with flake8
3232
run: |
3333
flake8 .
3434
- name: Lint with ruff
3535
run: |
3636
ruff check .
37+
- name: Check with black
38+
run: |
39+
black --check .
3740
3841
test:
3942
runs-on: ubuntu-latest

src/core/bugcheck_error.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import typing
55

6-
76
# //////////////////////////////////////////////////////////////////////////////
87
# BugCheckError
98

src/core/controller_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def Option__set_Value(optionData: PgCfgModel__OptionData, value: typing.Any):
3636

3737
# --------------------------------------------------------------------
3838
@staticmethod
39-
def Option__add_ValueItem(optionData: PgCfgModel__OptionData, valueItem: typing.Any):
39+
def Option__add_ValueItem(
40+
optionData: PgCfgModel__OptionData, valueItem: typing.Any
41+
):
4042
assert type(optionData) is PgCfgModel__OptionData
4143
assert type(optionData.m_Value) is list
4244
assert valueItem is not None

src/core/model.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ class OptionData(FileLineElementData):
9393

9494
# --------------------------------------------------------------------
9595
def __init__(
96-
self, parent: FileLineData, offset: typing.Optional[int], name: str, value: typing.Any
96+
self,
97+
parent: FileLineData,
98+
offset: typing.Optional[int],
99+
name: str,
100+
value: typing.Any,
97101
):
98102
assert type(parent) is FileLineData
99103
assert offset is None or type(offset) is int

src/core/option/handlers/prepare_set_value_item/option_handler_to_prepare_set_value_item__std__str.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def __init__(self):
2020
super().__init__()
2121

2222
# interface ----------------------------------------------------------
23-
def PrepareSetValueItem(self, ctx: OptionHandlerCtxToPrepareSetValueItem) -> typing.Any:
23+
def PrepareSetValueItem(
24+
self, ctx: OptionHandlerCtxToPrepareSetValueItem
25+
) -> typing.Any:
2426
assert type(ctx) is OptionHandlerCtxToPrepareSetValueItem
2527
assert isinstance(ctx.DataHandler, ConfigurationDataHandler)
2628
assert type(ctx.OptionName) is str

src/core/raise_error.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import datetime
55
import typing
66

7-
87
# //////////////////////////////////////////////////////////////////////////////
98
# RaiseError
109

@@ -194,7 +193,9 @@ def OptionIsAlreadyExistInFile(filePath: str, optionName: str):
194193

195194
# --------------------------------------------------------------------
196195
@staticmethod
197-
def OptionValueItemIsAlreadyDefined(filePath: str, optName: str, valueItem: typing.Any):
196+
def OptionValueItemIsAlreadyDefined(
197+
filePath: str, optName: str, valueItem: typing.Any
198+
):
198199
assert type(filePath) is str
199200
assert type(optName) is str
200201

src/implementation/v00/configuration_base.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ def get_Value(self) -> typing.Any:
194194
return r
195195

196196
# --------------------------------------------------------------------
197-
def set_Value(self, value: typing.Any) -> PostgresConfigurationSetOptionValueResult_Base:
197+
def set_Value(
198+
self, value: typing.Any
199+
) -> PostgresConfigurationSetOptionValueResult_Base:
198200
self.Helper__CheckAlive()
199201

200202
configuration = self.m_FileLine.get_Configuration()
@@ -789,7 +791,9 @@ def AddComment(self, text: str) -> PostgresConfigurationComment_Base:
789791
return fileLineComment
790792

791793
# --------------------------------------------------------------------
792-
def AddOption(self, name: str, value: typing.Any) -> PostgresConfigurationOption_Base:
794+
def AddOption(
795+
self, name: str, value: typing.Any
796+
) -> PostgresConfigurationOption_Base:
793797
DataVerificator.CheckOptionName(name)
794798

795799
assert name is not None
@@ -1441,7 +1445,9 @@ def AddTopLevelFile(self, path: str) -> PostgresConfigurationTopLevelFile_Base:
14411445
return file
14421446

14431447
# --------------------------------------------------------------------
1444-
def AddOption(self, name: str, value: typing.Any) -> PostgresConfigurationOption_Base:
1448+
def AddOption(
1449+
self, name: str, value: typing.Any
1450+
) -> PostgresConfigurationOption_Base:
14451451
DataVerificator.CheckOptionName(name)
14461452

14471453
assert name is not None
@@ -2099,7 +2105,9 @@ def Helper__FindFile(self, file_name: str) -> PgCfgModel__FileData:
20992105
BugCheckError.UnkFileObjectDataType(file_name_n, type(data))
21002106

21012107
# --------------------------------------------------------------------
2102-
def Helper__PrepareGetValue(self, optionName: str, optionValue: typing.Any) -> typing.Any:
2108+
def Helper__PrepareGetValue(
2109+
self, optionName: str, optionValue: typing.Any
2110+
) -> typing.Any:
21032111
assert optionName is not None
21042112
assert optionValue is not None
21052113
assert type(optionName) is str

src/os/abstract/configuration_os_ops.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import datetime
99
import typing
1010

11-
1211
# //////////////////////////////////////////////////////////////////////////////
1312
# class ConfigurationFileReader
1413

tests/ErrorMessageBuilder.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import datetime
55
import typing
66

7-
87
# //////////////////////////////////////////////////////////////////////////////
98
# class ErrorMessageBuilder
109

@@ -194,7 +193,9 @@ def OptionIsAlreadyExistInFile(filePath: str, optionName: str):
194193

195194
# --------------------------------------------------------------------
196195
@staticmethod
197-
def OptionValueItemIsAlreadyDefined(filePath: str, optName: str, valueItem: typing.Any):
196+
def OptionValueItemIsAlreadyDefined(
197+
filePath: str, optName: str, valueItem: typing.Any
198+
):
198199
assert type(filePath) is str
199200
assert type(optName) is str
200201

tests/implementation/v00/configuration_std/Mix/test_set001__generic_support_of_options.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,19 @@ class TestSet001__GenericSupportOfOptions:
2828

2929
# --------------------------------------------------------------------
3030
@pytest.fixture(params=sm_data001, ids=[x[0] for x in sm_data001])
31-
def data001(self, request: pytest.FixtureRequest) -> typing.Tuple[typing.Any, typing.Any]:
31+
def data001(
32+
self, request: pytest.FixtureRequest
33+
) -> typing.Tuple[typing.Any, typing.Any]:
3234
assert isinstance(request, pytest.FixtureRequest)
3335
assert type(request.param) is tuple
3436
assert len(request.param) == 3
3537
return request.param[1:]
3638

3739
# --------------------------------------------------------------------
3840
def test_001__set_get(
39-
self, request: pytest.FixtureRequest, data001: typing.Tuple[typing.Any, typing.Any]
41+
self,
42+
request: pytest.FixtureRequest,
43+
data001: typing.Tuple[typing.Any, typing.Any],
4044
):
4145
assert isinstance(request, pytest.FixtureRequest)
4246

@@ -59,15 +63,19 @@ def test_001__set_get(
5963

6064
# --------------------------------------------------------------------
6165
@pytest.fixture(params=sm_data002, ids=[x[0] for x in sm_data002])
62-
def data002(self, request: pytest.FixtureRequest) -> typing.Tuple[typing.Any, typing.Any]:
66+
def data002(
67+
self, request: pytest.FixtureRequest
68+
) -> typing.Tuple[typing.Any, typing.Any]:
6369
assert isinstance(request, pytest.FixtureRequest)
6470
assert type(request.param) is tuple
6571
assert len(request.param) == 3
6672
return request.param[1:]
6773

6874
# --------------------------------------------------------------------
6975
def test_002__write_and_read(
70-
self, request: pytest.FixtureRequest, data002: typing.Tuple[typing.Any, typing.Any]
76+
self,
77+
request: pytest.FixtureRequest,
78+
data002: typing.Tuple[typing.Any, typing.Any],
7179
):
7280
assert isinstance(request, pytest.FixtureRequest)
7381
assert type(data002) is tuple

0 commit comments

Comments
 (0)