eric7.Plugins.CheckerPlugins.SyntaxChecker.pyCheckSyntax
Module implementing the syntax check for Python 3.
Global Attributes
VcsConflictMarkerRegExpList |
Classes
Functions
__pySyntaxAndPyflakesCheck
__pySyntaxAndPyflakesCheck(filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False, additionalBuiltins=None, )
Function to compile one Python source file to Python bytecode
and to perform a pyflakes check.
- filename (str)
-
source filename
- codestring (str)
-
string containing the code to compile
- checkFlakes (bool)
-
flag indicating to do a pyflakes check
- ignoreStarImportWarnings (bool)
-
flag indicating to
ignore 'star import' warnings
- additionalBuiltins (list of str)
-
list of names pyflakes should consider as builtins
- Return:
-
list of dictionaries with the keys 'error', 'py_warnings' and 'warnings'
which contain a tuple with details about the syntax error or a list of
tuples with details about Python warnings and PyFlakes warnings. Each tuple
contains the file name, line number, column, code string (only for syntax
errors), the message and an optional list with arguments for the message.
- Return Type:
-
list of dict
extractLineFlags
extractLineFlags(line, startComment=")
Function to extract flags starting and ending with '__' from a line
comment.
- line (str)
-
line to extract flags from
- startComment (str)
-
string identifying the start of the comment
- endComment (str)
-
string identifying the end of a comment
- flagsLine (bool)
-
flag indicating to check for a flags only line
- Return:
-
list containing the extracted flags
- Return Type:
-
list of str
initBatchService
initBatchService()
Initialize the batch service and return the entry point.
- Return:
-
the entry point for the background client
- Return Type:
-
function
initService
initService()
Initialize the service and return the entry point.
- Return:
-
the entry point for the background client
- Return Type:
-
function
pySyntaxAndPyflakesBatchCheck
pySyntaxAndPyflakesBatchCheck(argumentsList, send, fx, cancelled, maxProcesses=0)
Module function to check syntax for a batch of files.
- argumentsList (list)
-
list of arguments tuples as given for pySyntaxAndPyflakesCheck
- send (function)
-
reference to send function
- fx (str)
-
registered service name
- cancelled (function)
-
reference to function checking for a cancellation
- maxProcesses (int)
-
number of processes to be used
pySyntaxAndPyflakesCheck
pySyntaxAndPyflakesCheck(filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False, additionalBuiltins=None, )
Function to compile one Python source file to Python bytecode
and to perform a pyflakes check.
- filename (str)
-
source filename
- codestring (str)
-
string containing the code to compile
- checkFlakes (bool)
-
flag indicating to do a pyflakes check
- ignoreStarImportWarnings (bool)
-
flag indicating to ignore 'star import' warnings
- additionalBuiltins (list of str)
-
list of names pyflakes should consider as builtins
- Return:
-
list of dictionaries with the keys 'error', 'py_warnings' and 'warnings'
which contain a tuple with details about the syntax error or a list of
tuples with details about Python warnings and PyFlakes warnings. Each tuple
contains the file name, line number, column, code string (only for syntax
errors), the message and an optional list with arguments for the message.
- Return Type:
-
list of dict
showwarning
showwarning(message, category, filename, lineno, file=None, line=None, )
workerTask
workerTask(inputQueue, outputQueue)
Module function acting as the parallel worker for the syntax check.
- inputQueue (multiprocessing.Queue)
-
input queue
- outputQueue (multiprocessing.Queue)
-
output queue