From c70daa346d3d6a6e687d362d697888e9ec8ec312 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 28 Apr 2023 14:50:35 +0200 Subject: [PATCH] Resolve pylint errors in release.py --- .gitlab-ci.yml | 2 +- src/main/python/ddadevops/domain/release.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 023a56b..6d8e287 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ pylint: stage: lint&test script: - pip install -r dev_requirements.txt - - pylint -d W0511,R0903,C0301,W0614,C0114,C0115,C0116,similarities,W0702,W0702,R0913,R0902,R0914,R1732 src/main/python/ddadevops/ + - pylint -d W0511,R0903,C0301,W0614,C0114,C0115,C0116,similarities,W0719,W0702,W0702,R0913,R0902,R0914,R1732 src/main/python/ddadevops/ pytest: stage: lint&test diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index 882a8fc..2c27b4a 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -18,8 +18,8 @@ class EnvironmentKeys(Enum): class Version(): - def __init__(self, id: Path, version_list: list): - self.id = id + def __init__(self, path: Path, version_list: list): + self.path = path self.version_list = version_list self.version_string: Optional[str | None] = None self.is_snapshot: Optional[bool | None] = None @@ -42,7 +42,7 @@ class Version(): self.version_list[ReleaseType.MINOR.value] = 0 self.version_list[ReleaseType.MAJOR.value] += 1 case None: - raise Exception("Release Type was not set!") + raise RuntimeError("Release Type was not set!") def get_version_string(self) -> str: self.version_string = ".".join([str(x) for x in self.version_list]) @@ -51,13 +51,13 @@ class Version(): return self.version_string def create_release_version(self, release_type: ReleaseType | None): - release_version = Version(self.id, self.version_list.copy()) + release_version = Version(self.path, self.version_list.copy()) release_version.is_snapshot = self.is_snapshot release_version.increment(release_type) return release_version def create_bump_version(self): - bump_version = Version(self.id, self.version_list.copy()) + bump_version = Version(self.path, self.version_list.copy()) bump_version.is_snapshot = self.is_snapshot bump_version.increment(ReleaseType.BUMP) return bump_version @@ -99,9 +99,9 @@ class Release(Validateable): self.config_file = config_file self.release_context: ReleaseContext | None = None - def set_release_context(self, set_release_context: ReleaseContext): + def set_release_context(self, set_release_context: ReleaseContext): self.release_context = set_release_context - + def release_version(self): return self.release_context.release_version()