Resolve pylint errors in release.py
This commit is contained in:
parent
7cace08a87
commit
bc7d8e1d87
2 changed files with 8 additions and 8 deletions
|
@ -27,7 +27,7 @@ pylint:
|
||||||
stage: lint&test
|
stage: lint&test
|
||||||
script:
|
script:
|
||||||
- pip install -r dev_requirements.txt
|
- 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:
|
pytest:
|
||||||
stage: lint&test
|
stage: lint&test
|
||||||
|
|
|
@ -18,8 +18,8 @@ class EnvironmentKeys(Enum):
|
||||||
|
|
||||||
class Version():
|
class Version():
|
||||||
|
|
||||||
def __init__(self, id: Path, version_list: list):
|
def __init__(self, path: Path, version_list: list):
|
||||||
self.id = id
|
self.path = path
|
||||||
self.version_list = version_list
|
self.version_list = version_list
|
||||||
self.version_string: Optional[str | None] = None
|
self.version_string: Optional[str | None] = None
|
||||||
self.is_snapshot: Optional[bool | 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.MINOR.value] = 0
|
||||||
self.version_list[ReleaseType.MAJOR.value] += 1
|
self.version_list[ReleaseType.MAJOR.value] += 1
|
||||||
case None:
|
case None:
|
||||||
raise Exception("Release Type was not set!")
|
raise RuntimeError("Release Type was not set!")
|
||||||
|
|
||||||
def get_version_string(self) -> str:
|
def get_version_string(self) -> str:
|
||||||
self.version_string = ".".join([str(x) for x in self.version_list])
|
self.version_string = ".".join([str(x) for x in self.version_list])
|
||||||
|
@ -51,13 +51,13 @@ class Version():
|
||||||
return self.version_string
|
return self.version_string
|
||||||
|
|
||||||
def create_release_version(self, release_type: ReleaseType | None):
|
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.is_snapshot = self.is_snapshot
|
||||||
release_version.increment(release_type)
|
release_version.increment(release_type)
|
||||||
return release_version
|
return release_version
|
||||||
|
|
||||||
def create_bump_version(self):
|
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.is_snapshot = self.is_snapshot
|
||||||
bump_version.increment(ReleaseType.BUMP)
|
bump_version.increment(ReleaseType.BUMP)
|
||||||
return bump_version
|
return bump_version
|
||||||
|
|
Loading…
Reference in a new issue