eric7.Plugins.CheckerPlugins.DocStyleChecker.DocStyleChecker
Module implementing the documentation style checker.
Global Attributes
Classes
Functions
| __checkDocStyle |
Private module function to perform the source code documentation style check and/or fix found errors. |
| __checkSyntax |
Private module function to perform a syntax check. |
| docStyleBatchCheck |
Module function to check source code documentation style for a batch of files. |
| docStyleCheck |
Do the source code documentation style check and/or fix found errors. |
| extractLineFlags |
Function to extract flags starting and ending with '__' or being introduced with 'noqa:' from a line comment. |
| ignoreCode |
Function to check, if the given code should be ignored as per line flags. |
| initBatchService |
Initialize the batch service and return the entry point. |
| initService |
Initialize the service and return the entry point. |
| workerTask |
Module function acting as the parallel worker for the style check. |
__checkDocStyle
__checkDocStyle(filename, source, args)
Private module function to perform the source code documentation style check
and/or fix found errors.
- filename (str)
-
source filename
- source (list of str)
-
list of code lines to be checked
- args (list of (str, str, bool, str, str, bool, int, str, list of str, str, str,)
-
arguments used by the docStyleCheck function (list of
excludeMessages, includeMessages, repeatMessages, fixCodes,
noFixCodes, fixIssues, maxLineLength, docType, errors, eol, encoding, backup)
bool)
- Return:
-
tuple of statistics data and list of result dictionaries with
keys:
- file: file name
- line: line_number
- offset: offset within line
- code: error message code
- args: list of arguments to format the message
- ignored: flag indicating this issue was ignored
- fixed: flag indicating this issue was fixed
- autofixing: flag indicating that a fix can be done
- fixcode: message code for the fix
- fixargs: list of arguments to format the fix message
- Return Type:
-
tuple of (dict, list of dict)
__checkSyntax
__checkSyntax(filename, source)
Private module function to perform a syntax check.
- filename (str)
-
source filename
- source (list of str)
-
list of code lines to be checked
- Return:
-
tuple containing the error dictionary with syntax error details,
a statistics dictionary and None or a tuple containing two None and
the generated AST tree
- Return Type:
-
tuple of (dict, dict, None) or tuple of (None, None, ast.Module)
docStyleBatchCheck
docStyleBatchCheck(argumentsList, send, fx, cancelled, maxProcesses=0)
Module function to check source code documentation style for a batch of files.
- argumentsList (list)
-
list of arguments tuples as given for docStyleCheck
- send (func)
-
reference to send function
- fx (str)
-
registered service name
- cancelled (func)
-
reference to function checking for a cancellation
- maxProcesses (int)
-
number of processes to be used
docStyleCheck
docStyleCheck(filename, source, args)
Do the source code documentation style check and/or fix found errors.
- filename (str)
-
source filename
- source (list of str)
-
list of code lines to be checked
- args (list of (str, str, bool, str, str, bool, int, str, list of str, str, str,)
-
arguments used by the docStyleCheck function (list of
excludeMessages, includeMessages, repeatMessages, fixCodes,
noFixCodes, fixIssues, maxLineLength, docType, errors, eol, encoding, backup)
bool)
- Return:
-
tuple of statistics (dict) and list of results (tuple for each
found violation of documentation style (lineno, position, text, ignored, fixed,
autofixing, fixedMsg))
- Return Type:
-
tuple of (dict, list of tuples of (int, int, str, bool, bool, bool, str))
extractLineFlags
extractLineFlags(line, startComment=")
Function to extract flags starting and ending with '__' or being introduced with
'noqa:' 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
ignoreCode
ignoreCode(errorCode, lineFlags)
Function to check, if the given code should be ignored as per line flags.
- errorCode (str)
-
error code to be checked
- lineFlags (list of str)
-
list of line flags to check against
- Return:
-
flag indicating to ignore the error code
- Return Type:
-
bool
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
workerTask
workerTask(inputQueue, outputQueue)
Module function acting as the parallel worker for the style check.
- inputQueue (multiprocessing.Queue)
-
input queue
- outputQueue (multiprocessing.Queue)
-
output queue