lint fixes
This commit is contained in:
parent
96b3d3c8a6
commit
c916d1268e
|
|
@ -418,6 +418,7 @@ disable=raw-checker-failed,
|
||||||
use-symbolic-message-instead,
|
use-symbolic-message-instead,
|
||||||
C0114, C0115, C0116, # docstrings
|
C0114, C0115, C0116, # docstrings
|
||||||
C0103, # var naming
|
C0103, # var naming
|
||||||
|
R0205, # filter_plugins 'FilterModule'
|
||||||
|
|
||||||
# Enable the message, report, category or checker with the given id(s). You can
|
# Enable the message, report, category or checker with the given id(s). You can
|
||||||
# either give multiple identifier separated by comma (,) or put this option
|
# either give multiple identifier separated by comma (,) or put this option
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@ class FilterModule(object):
|
||||||
r'([a-zA-Z0-9][-_.a-zA-Z0-9]{0,61}[a-zA-Z0-9]))\.'
|
r'([a-zA-Z0-9][-_.a-zA-Z0-9]{0,61}[a-zA-Z0-9]))\.'
|
||||||
r'([a-zA-Z]{2,13}|[a-zA-Z0-9-]{2,30}.[a-zA-Z]{2,3})$'
|
r'([a-zA-Z]{2,13}|[a-zA-Z0-9-]{2,30}.[a-zA-Z]{2,3})$'
|
||||||
)
|
)
|
||||||
valid_domain = True if domain.match(name) is not None else False
|
valid_domain = domain.match(name) is not None
|
||||||
# see: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
|
# see: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
|
||||||
expr_hostname = r'^[a-zA-Z0-9-\.]{1,253}$'
|
expr_hostname = r'^[a-zA-Z0-9-\.]{1,253}$'
|
||||||
valid_hostname = True if regex_match(expr_hostname, name) is not None else False
|
valid_hostname = regex_match(expr_hostname, name) is not None
|
||||||
return all([valid_domain, valid_hostname])
|
return all([valid_domain, valid_hostname])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
@ -93,8 +93,7 @@ class FilterModule(object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def ensure_list(data: (str, dict, list)) -> list:
|
def ensure_list(data: (str, dict, list)) -> list:
|
||||||
# if user supplied a string instead of a list => convert it to match our expectations
|
# if user supplied a string instead of a list => convert it to match our expectations
|
||||||
if type(data) == list:
|
if isinstance(data, list):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
else:
|
return [data]
|
||||||
return [data]
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue