Skip to content

Commit

Permalink
fix E721 lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertShan2000 committed Aug 23, 2023
1 parent 61efc01 commit 53015c7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/awsrun/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def __init__(self, type_):
self.type = type_

def type_check(self, obj):
return type(obj) == self.type
return type(obj) == self.type # noqa: E721

def __str__(self):
return self.type.__name__
Expand All @@ -354,7 +354,7 @@ def __init__(self, pattern):
self.pattern = pattern

def type_check(self, obj):
if type(obj) != str:
if type(obj) != str: # noqa: E721
return False
return bool(re.search(self.pattern, obj))

Expand All @@ -366,7 +366,7 @@ class IpAddress(Type):
"""Represents a string matching an IP address (v4 or v6)."""

def type_check(self, obj):
if type(obj) != str:
if type(obj) != str: # noqa: E721
return False
try:
ipaddress.ip_address(obj)
Expand All @@ -382,7 +382,7 @@ class IpNetwork(Type):
"""Represents a string matching an IP network (v4 or v6)."""

def type_check(self, obj):
if type(obj) != str:
if type(obj) != str: # noqa: E721
return False
try:
ipaddress.ip_network(obj)
Expand All @@ -398,7 +398,7 @@ class FileType(Type):
"""Represents a string pointing to an existing file."""

def type_check(self, obj):
if type(obj) != str:
if type(obj) != str: # noqa: E721
return False
return Path(obj).exists()

Expand Down Expand Up @@ -462,7 +462,7 @@ def __init__(self, element_type):
self.element_type = element_type

def type_check(self, obj):
if type(obj) != list:
if type(obj) != list: # noqa: E721
return False
return all(self.element_type.type_check(e) for e in obj)

Expand All @@ -485,7 +485,7 @@ def __init__(self, key_type, value_type):
self.value_type = value_type

def type_check(self, obj):
if type(obj) != dict:
if type(obj) != dict: # noqa: E721
return False
return all(self.key_type.type_check(k) for k in obj.keys()) and all(
self.value_type.type_check(v) for v in obj.values()
Expand Down

0 comments on commit 53015c7

Please sign in to comment.