mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 18:44:27 +02:00
PyLint fixes
This commit is contained in:
@@ -223,6 +223,7 @@ if "envdump" in COMMAND_LINE_TARGETS:
|
||||
env.Exit(0)
|
||||
|
||||
if set(["_idedata", "idedata"]) & set(COMMAND_LINE_TARGETS):
|
||||
projenv = None
|
||||
try:
|
||||
Import("projenv")
|
||||
except: # pylint: disable=bare-except
|
||||
|
@@ -21,7 +21,7 @@ from platformio.package.manager.core import get_core_package_dir
|
||||
|
||||
|
||||
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:
|
||||
return ""
|
||||
|
||||
@@ -34,7 +34,7 @@ class ClangtidyCheckTool(CheckToolBase):
|
||||
|
||||
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)
|
||||
if not match:
|
||||
return raw_line
|
||||
|
@@ -38,7 +38,7 @@ class CppcheckCheckTool(CheckToolBase):
|
||||
]
|
||||
super(CppcheckCheckTool, self).__init__(*args, **kwargs)
|
||||
|
||||
def tool_output_filter(self, line):
|
||||
def tool_output_filter(self, line): # pylint: disable=arguments-differ
|
||||
if (
|
||||
not self.options.get("verbose")
|
||||
and "--suppress=unmatchedSuppression:" in line
|
||||
@@ -56,7 +56,7 @@ class CppcheckCheckTool(CheckToolBase):
|
||||
|
||||
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:
|
||||
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():
|
||||
self._bad_input = True
|
||||
return line
|
||||
|
@@ -69,7 +69,9 @@ class LockFile(object):
|
||||
if LOCKFILE_CURRENT_INTERFACE == LOCKFILE_INTERFACE_FCNTL:
|
||||
fcntl.flock(self._fp.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
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):
|
||||
self._fp.close()
|
||||
self._fp = None
|
||||
|
@@ -68,7 +68,7 @@ class TARArchiver(BaseArchiver):
|
||||
return item.name
|
||||
|
||||
@staticmethod
|
||||
def is_link(item):
|
||||
def is_link(item): # pylint: disable=arguments-differ
|
||||
return item.islnk() or item.issym()
|
||||
|
||||
@staticmethod
|
||||
@@ -119,7 +119,7 @@ class ZIPArchiver(BaseArchiver):
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def is_link(_):
|
||||
def is_link(_): # pylint: disable=arguments-differ
|
||||
return False
|
||||
|
||||
def get_items(self):
|
||||
|
Reference in New Issue
Block a user