diff --git a/.github/workflows/package-verification.yml b/.github/workflows/package-verification.yml index a1df507..3206b7c 100644 --- a/.github/workflows/package-verification.yml +++ b/.github/workflows/package-verification.yml @@ -27,13 +27,16 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 flake8-pyproject ruff + python -m pip install flake8 flake8-pyproject ruff black - name: Lint with flake8 run: | flake8 . - name: Lint with ruff run: | ruff check . + - name: Check with black + run: | + black --check . test: runs-on: ubuntu-latest diff --git a/src/core/bugcheck_error.py b/src/core/bugcheck_error.py index 7b0e9c4..3ed6a53 100644 --- a/src/core/bugcheck_error.py +++ b/src/core/bugcheck_error.py @@ -3,7 +3,6 @@ import typing - # ////////////////////////////////////////////////////////////////////////////// # BugCheckError diff --git a/src/core/controller_utils.py b/src/core/controller_utils.py index 4ec6a2a..b71be6b 100644 --- a/src/core/controller_utils.py +++ b/src/core/controller_utils.py @@ -36,7 +36,9 @@ def Option__set_Value(optionData: PgCfgModel__OptionData, value: typing.Any): # -------------------------------------------------------------------- @staticmethod - def Option__add_ValueItem(optionData: PgCfgModel__OptionData, valueItem: typing.Any): + def Option__add_ValueItem( + optionData: PgCfgModel__OptionData, valueItem: typing.Any + ): assert type(optionData) is PgCfgModel__OptionData assert type(optionData.m_Value) is list assert valueItem is not None diff --git a/src/core/model.py b/src/core/model.py index 1f49ac3..bdf385d 100644 --- a/src/core/model.py +++ b/src/core/model.py @@ -93,7 +93,11 @@ class OptionData(FileLineElementData): # -------------------------------------------------------------------- def __init__( - self, parent: FileLineData, offset: typing.Optional[int], name: str, value: typing.Any + self, + parent: FileLineData, + offset: typing.Optional[int], + name: str, + value: typing.Any, ): assert type(parent) is FileLineData assert offset is None or type(offset) is int diff --git a/src/core/option/handlers/prepare_set_value_item/option_handler_to_prepare_set_value_item__std__str.py b/src/core/option/handlers/prepare_set_value_item/option_handler_to_prepare_set_value_item__std__str.py index 9f9fcb9..2df8950 100644 --- a/src/core/option/handlers/prepare_set_value_item/option_handler_to_prepare_set_value_item__std__str.py +++ b/src/core/option/handlers/prepare_set_value_item/option_handler_to_prepare_set_value_item__std__str.py @@ -20,7 +20,9 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def PrepareSetValueItem(self, ctx: OptionHandlerCtxToPrepareSetValueItem) -> typing.Any: + def PrepareSetValueItem( + self, ctx: OptionHandlerCtxToPrepareSetValueItem + ) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareSetValueItem assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/raise_error.py b/src/core/raise_error.py index 6dc8396..d9762e3 100644 --- a/src/core/raise_error.py +++ b/src/core/raise_error.py @@ -4,7 +4,6 @@ import datetime import typing - # ////////////////////////////////////////////////////////////////////////////// # RaiseError @@ -194,7 +193,9 @@ def OptionIsAlreadyExistInFile(filePath: str, optionName: str): # -------------------------------------------------------------------- @staticmethod - def OptionValueItemIsAlreadyDefined(filePath: str, optName: str, valueItem: typing.Any): + def OptionValueItemIsAlreadyDefined( + filePath: str, optName: str, valueItem: typing.Any + ): assert type(filePath) is str assert type(optName) is str diff --git a/src/implementation/v00/configuration_base.py b/src/implementation/v00/configuration_base.py index b72f50e..6d590d7 100644 --- a/src/implementation/v00/configuration_base.py +++ b/src/implementation/v00/configuration_base.py @@ -194,7 +194,9 @@ def get_Value(self) -> typing.Any: return r # -------------------------------------------------------------------- - def set_Value(self, value: typing.Any) -> PostgresConfigurationSetOptionValueResult_Base: + def set_Value( + self, value: typing.Any + ) -> PostgresConfigurationSetOptionValueResult_Base: self.Helper__CheckAlive() configuration = self.m_FileLine.get_Configuration() @@ -789,7 +791,9 @@ def AddComment(self, text: str) -> PostgresConfigurationComment_Base: return fileLineComment # -------------------------------------------------------------------- - def AddOption(self, name: str, value: typing.Any) -> PostgresConfigurationOption_Base: + def AddOption( + self, name: str, value: typing.Any + ) -> PostgresConfigurationOption_Base: DataVerificator.CheckOptionName(name) assert name is not None @@ -1441,7 +1445,9 @@ def AddTopLevelFile(self, path: str) -> PostgresConfigurationTopLevelFile_Base: return file # -------------------------------------------------------------------- - def AddOption(self, name: str, value: typing.Any) -> PostgresConfigurationOption_Base: + def AddOption( + self, name: str, value: typing.Any + ) -> PostgresConfigurationOption_Base: DataVerificator.CheckOptionName(name) assert name is not None @@ -2099,7 +2105,9 @@ def Helper__FindFile(self, file_name: str) -> PgCfgModel__FileData: BugCheckError.UnkFileObjectDataType(file_name_n, type(data)) # -------------------------------------------------------------------- - def Helper__PrepareGetValue(self, optionName: str, optionValue: typing.Any) -> typing.Any: + def Helper__PrepareGetValue( + self, optionName: str, optionValue: typing.Any + ) -> typing.Any: assert optionName is not None assert optionValue is not None assert type(optionName) is str diff --git a/src/os/abstract/configuration_os_ops.py b/src/os/abstract/configuration_os_ops.py index 27b46f7..e19c152 100644 --- a/src/os/abstract/configuration_os_ops.py +++ b/src/os/abstract/configuration_os_ops.py @@ -8,7 +8,6 @@ import datetime import typing - # ////////////////////////////////////////////////////////////////////////////// # class ConfigurationFileReader diff --git a/tests/ErrorMessageBuilder.py b/tests/ErrorMessageBuilder.py index 0580697..e2cefda 100644 --- a/tests/ErrorMessageBuilder.py +++ b/tests/ErrorMessageBuilder.py @@ -4,7 +4,6 @@ import datetime import typing - # ////////////////////////////////////////////////////////////////////////////// # class ErrorMessageBuilder @@ -194,7 +193,9 @@ def OptionIsAlreadyExistInFile(filePath: str, optionName: str): # -------------------------------------------------------------------- @staticmethod - def OptionValueItemIsAlreadyDefined(filePath: str, optName: str, valueItem: typing.Any): + def OptionValueItemIsAlreadyDefined( + filePath: str, optName: str, valueItem: typing.Any + ): assert type(filePath) is str assert type(optName) is str diff --git a/tests/implementation/v00/configuration_std/Mix/test_set001__generic_support_of_options.py b/tests/implementation/v00/configuration_std/Mix/test_set001__generic_support_of_options.py index 32293d4..01691e1 100644 --- a/tests/implementation/v00/configuration_std/Mix/test_set001__generic_support_of_options.py +++ b/tests/implementation/v00/configuration_std/Mix/test_set001__generic_support_of_options.py @@ -28,7 +28,9 @@ class TestSet001__GenericSupportOfOptions: # -------------------------------------------------------------------- @pytest.fixture(params=sm_data001, ids=[x[0] for x in sm_data001]) - def data001(self, request: pytest.FixtureRequest) -> typing.Tuple[typing.Any, typing.Any]: + def data001( + self, request: pytest.FixtureRequest + ) -> typing.Tuple[typing.Any, typing.Any]: assert isinstance(request, pytest.FixtureRequest) assert type(request.param) is tuple assert len(request.param) == 3 @@ -36,7 +38,9 @@ def data001(self, request: pytest.FixtureRequest) -> typing.Tuple[typing.Any, ty # -------------------------------------------------------------------- def test_001__set_get( - self, request: pytest.FixtureRequest, data001: typing.Tuple[typing.Any, typing.Any] + self, + request: pytest.FixtureRequest, + data001: typing.Tuple[typing.Any, typing.Any], ): assert isinstance(request, pytest.FixtureRequest) @@ -59,7 +63,9 @@ def test_001__set_get( # -------------------------------------------------------------------- @pytest.fixture(params=sm_data002, ids=[x[0] for x in sm_data002]) - def data002(self, request: pytest.FixtureRequest) -> typing.Tuple[typing.Any, typing.Any]: + def data002( + self, request: pytest.FixtureRequest + ) -> typing.Tuple[typing.Any, typing.Any]: assert isinstance(request, pytest.FixtureRequest) assert type(request.param) is tuple assert len(request.param) == 3 @@ -67,7 +73,9 @@ def data002(self, request: pytest.FixtureRequest) -> typing.Tuple[typing.Any, ty # -------------------------------------------------------------------- def test_002__write_and_read( - self, request: pytest.FixtureRequest, data002: typing.Tuple[typing.Any, typing.Any] + self, + request: pytest.FixtureRequest, + data002: typing.Tuple[typing.Any, typing.Any], ): assert isinstance(request, pytest.FixtureRequest) assert type(data002) is tuple diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py index f3be455..ce8cf9d 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py @@ -413,7 +413,9 @@ def test_011__empty_name(self, request: pytest.FixtureRequest): # -------------------------------------------------------------------- @pytest.fixture(params=sm_data012__values, ids=[x[0] for x in sm_data012__values]) - def data012(self, request: pytest.FixtureRequest) -> typing.Tuple[str, typing.Any, typing.Any]: + def data012( + self, request: pytest.FixtureRequest + ) -> typing.Tuple[str, typing.Any, typing.Any]: assert isinstance(request, pytest.FixtureRequest) assert type(request.param) is tuple assert len(request.param) == 4 @@ -422,7 +424,9 @@ def data012(self, request: pytest.FixtureRequest) -> typing.Tuple[str, typing.An # -------------------------------------------------------------------- def test_012__one_opt( - self, request: pytest.FixtureRequest, data012: typing.Tuple[str, typing.Any, typing.Any] + self, + request: pytest.FixtureRequest, + data012: typing.Tuple[str, typing.Any, typing.Any], ): assert isinstance(request, pytest.FixtureRequest) assert type(data012) is tuple diff --git a/tests/implementation/v00/configuration_std/Options/STD/listen_addresses/test_set001__common.py b/tests/implementation/v00/configuration_std/Options/STD/listen_addresses/test_set001__common.py index 29f0624..ee9cea5 100644 --- a/tests/implementation/v00/configuration_std/Options/STD/listen_addresses/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Options/STD/listen_addresses/test_set001__common.py @@ -13,7 +13,6 @@ import pytest import re - # ////////////////////////////////////////////////////////////////////////////// # TestSet001__Common