eric7.Plugins.CheckerPlugins.DocStyleChecker.DocStyleChecker

Module implementing the documentation style checker.

Global Attributes

None

Classes

None

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:
Return Type:
tuple of (dict, list of dict)
Up


__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)
Up


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
Up


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))
Up


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
Up


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
Up


initBatchService

initBatchService()

Initialize the batch service and return the entry point.

Return:
the entry point for the background client
Return Type:
function
Up


initService

initService()

Initialize the service and return the entry point.

Return:
the entry point for the background client
Return Type:
function
Up


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
Up