Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/package-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/core/bugcheck_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import typing


# //////////////////////////////////////////////////////////////////////////////
# BugCheckError

Expand Down
4 changes: 3 additions & 1 deletion src/core/controller_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/core/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/core/raise_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import datetime
import typing


# //////////////////////////////////////////////////////////////////////////////
# RaiseError

Expand Down Expand Up @@ -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

Expand Down
16 changes: 12 additions & 4 deletions src/implementation/v00/configuration_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/os/abstract/configuration_os_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import datetime
import typing


# //////////////////////////////////////////////////////////////////////////////
# class ConfigurationFileReader

Expand Down
5 changes: 3 additions & 2 deletions tests/ErrorMessageBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import datetime
import typing


# //////////////////////////////////////////////////////////////////////////////
# class ErrorMessageBuilder

Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ 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
return request.param[1:]

# --------------------------------------------------------------------
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)

Expand All @@ -59,15 +63,19 @@ 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
return request.param[1:]

# --------------------------------------------------------------------
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import pytest
import re


# //////////////////////////////////////////////////////////////////////////////
# TestSet001__Common

Expand Down