Resolve pylint errors in common.py
This commit is contained in:
parent
bc7d8e1d87
commit
e0b30adf9f
2 changed files with 8 additions and 6 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,W0719,W0702,W0702,R0913,R0902,R0914,R1732 src/main/python/ddadevops/
|
- pylint -d W0511,R0903,C0301,W0614,C0114,C0115,C0116,similarities,W1203,W0719,W0702,W0702,R0913,R0902,R0914,R1732 src/main/python/ddadevops/
|
||||||
|
|
||||||
pytest:
|
pytest:
|
||||||
stage: lint&test
|
stage: lint&test
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import deprecation
|
import deprecation
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import List
|
from typing import List
|
||||||
|
import logging
|
||||||
|
import deprecation
|
||||||
|
|
||||||
def filter_none(list_to_filter):
|
def filter_none(list_to_filter):
|
||||||
return [x for x in list_to_filter if x is not None]
|
return [x for x in list_to_filter if x is not None]
|
||||||
|
@ -10,8 +12,8 @@ class Validateable:
|
||||||
value = self.__dict__[field_name]
|
value = self.__dict__[field_name]
|
||||||
if value is None or value == "":
|
if value is None or value == "":
|
||||||
return [f"Field '{field_name}' must not be empty."]
|
return [f"Field '{field_name}' must not be empty."]
|
||||||
else:
|
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def validate(self) -> List[str]:
|
def validate(self) -> List[str]:
|
||||||
return []
|
return []
|
||||||
|
@ -65,13 +67,13 @@ class Devops(Validateable):
|
||||||
def __put__(self, key, value):
|
def __put__(self, key, value):
|
||||||
self.stack[key] = value
|
self.stack[key] = value
|
||||||
|
|
||||||
def __get__(self, key):
|
def __get(self, key):
|
||||||
return self.stack[key]
|
return self.stack[key]
|
||||||
|
|
||||||
def __get_keys__(self, keys):
|
def __get_keys__(self, keys):
|
||||||
result = {}
|
result = {}
|
||||||
for key in keys:
|
for key in keys:
|
||||||
result[key] = self.__get__(key)
|
result[key] = self.__get(key)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
class BuildType(Enum):
|
class BuildType(Enum):
|
||||||
|
|
Loading…
Reference in a new issue