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
|
||||
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
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue