forked from platformio/platformio-core
PyLint fixes
This commit is contained in:
@@ -223,6 +223,7 @@ if "envdump" in COMMAND_LINE_TARGETS:
|
|||||||
env.Exit(0)
|
env.Exit(0)
|
||||||
|
|
||||||
if set(["_idedata", "idedata"]) & set(COMMAND_LINE_TARGETS):
|
if set(["_idedata", "idedata"]) & set(COMMAND_LINE_TARGETS):
|
||||||
|
projenv = None
|
||||||
try:
|
try:
|
||||||
Import("projenv")
|
Import("projenv")
|
||||||
except: # pylint: disable=bare-except
|
except: # pylint: disable=bare-except
|
||||||
|
@@ -21,7 +21,7 @@ from platformio.package.manager.core import get_core_package_dir
|
|||||||
|
|
||||||
|
|
||||||
class ClangtidyCheckTool(CheckToolBase):
|
class ClangtidyCheckTool(CheckToolBase):
|
||||||
def tool_output_filter(self, line):
|
def tool_output_filter(self, line): # pylint: disable=arguments-differ
|
||||||
if not self.options.get("verbose") and "[clang-diagnostic-error]" in line:
|
if not self.options.get("verbose") and "[clang-diagnostic-error]" in line:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ class ClangtidyCheckTool(CheckToolBase):
|
|||||||
|
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def parse_defect(self, raw_line):
|
def parse_defect(self, raw_line): # pylint: disable=arguments-differ
|
||||||
match = re.match(r"^(.*):(\d+):(\d+):\s+([^:]+):\s(.+)\[([^]]+)\]$", raw_line)
|
match = re.match(r"^(.*):(\d+):(\d+):\s+([^:]+):\s(.+)\[([^]]+)\]$", raw_line)
|
||||||
if not match:
|
if not match:
|
||||||
return raw_line
|
return raw_line
|
||||||
|
@@ -38,7 +38,7 @@ class CppcheckCheckTool(CheckToolBase):
|
|||||||
]
|
]
|
||||||
super(CppcheckCheckTool, self).__init__(*args, **kwargs)
|
super(CppcheckCheckTool, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
def tool_output_filter(self, line):
|
def tool_output_filter(self, line): # pylint: disable=arguments-differ
|
||||||
if (
|
if (
|
||||||
not self.options.get("verbose")
|
not self.options.get("verbose")
|
||||||
and "--suppress=unmatchedSuppression:" in line
|
and "--suppress=unmatchedSuppression:" in line
|
||||||
@@ -56,7 +56,7 @@ class CppcheckCheckTool(CheckToolBase):
|
|||||||
|
|
||||||
return line
|
return line
|
||||||
|
|
||||||
def parse_defect(self, raw_line):
|
def parse_defect(self, raw_line): # pylint: disable=arguments-differ
|
||||||
if self._field_delimiter not in raw_line:
|
if self._field_delimiter not in raw_line:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ class PvsStudioCheckTool(CheckToolBase): # pylint: disable=too-many-instance-at
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def tool_output_filter(self, line):
|
def tool_output_filter(self, line): # pylint: disable=arguments-differ
|
||||||
if "license was not entered" in line.lower():
|
if "license was not entered" in line.lower():
|
||||||
self._bad_input = True
|
self._bad_input = True
|
||||||
return line
|
return line
|
||||||
|
@@ -69,7 +69,9 @@ class LockFile(object):
|
|||||||
if LOCKFILE_CURRENT_INTERFACE == LOCKFILE_INTERFACE_FCNTL:
|
if LOCKFILE_CURRENT_INTERFACE == LOCKFILE_INTERFACE_FCNTL:
|
||||||
fcntl.flock(self._fp.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
|
fcntl.flock(self._fp.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||||
elif LOCKFILE_CURRENT_INTERFACE == LOCKFILE_INTERFACE_MSVCRT:
|
elif LOCKFILE_CURRENT_INTERFACE == LOCKFILE_INTERFACE_MSVCRT:
|
||||||
msvcrt.locking(self._fp.fileno(), msvcrt.LK_NBLCK, 1)
|
msvcrt.locking( # pylint: disable=used-before-assignment
|
||||||
|
self._fp.fileno(), msvcrt.LK_NBLCK, 1
|
||||||
|
)
|
||||||
except (BlockingIOError, IOError):
|
except (BlockingIOError, IOError):
|
||||||
self._fp.close()
|
self._fp.close()
|
||||||
self._fp = None
|
self._fp = None
|
||||||
|
@@ -68,7 +68,7 @@ class TARArchiver(BaseArchiver):
|
|||||||
return item.name
|
return item.name
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def is_link(item):
|
def is_link(item): # pylint: disable=arguments-differ
|
||||||
return item.islnk() or item.issym()
|
return item.islnk() or item.issym()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -119,7 +119,7 @@ class ZIPArchiver(BaseArchiver):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def is_link(_):
|
def is_link(_): # pylint: disable=arguments-differ
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_items(self):
|
def get_items(self):
|
||||||
|
Reference in New Issue
Block a user