eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker

Module implementing the code style checker.

Global Attributes

None

Classes

CodeStyleCheckerReport Class implementing a special report to be used with our dialog.

Functions

__checkCodeStyle Private module function to perform the code style check and/or fix found errors.
codeStyleBatchCheck Module function to check code style for a batch of files.
codeStyleCheck Do the code style check and/ or fix found errors.
extractLineFlags Function to extract flags starting and ending with '__' from a line comment.
initBatchService Initialize the batch service and return the entry point.
initService Initialize the service and return the entry point.
worker Module function acting as the parallel worker for the style check.


CodeStyleCheckerReport

Class implementing a special report to be used with our dialog.

Derived from

pycodestyle.BaseReport

Class Attributes

None

Class Methods

None

Methods

CodeStyleCheckerReport Constructor
error_args Public method to collect the error messages.

Static Methods

None

CodeStyleCheckerReport (Constructor)

CodeStyleCheckerReport(options)

Constructor

options
options for the report (optparse.Values)

CodeStyleCheckerReport.error_args

error_args(line_number, offset, code, check, *args)

Public method to collect the error messages.

line_number
line number of the issue (integer)
offset
position within line of the issue (integer)
code
message code (string)
check
reference to the checker function (function)
args
arguments for the message (list)
Returns:
error code (string)
Up


__checkCodeStyle

__checkCodeStyle(filename, source, args)

Private module function to perform the code style check and/or fix found errors.

filename
source filename (string)
source
string containing the code to check (string)
args
arguments used by the codeStyleCheck function (list of excludeMessages (str), includeMessages (str), repeatMessages (bool), fixCodes (str), noFixCodes (str), fixIssues (bool), maxLineLength (int), hangClosing (bool), docType (str), errors (list of str), eol (str), encoding (str), backup (bool))
Returns:
tuple of stats (dict) and results (tuple for each found violation of style (tuple of lineno (int), position (int), text (str), ignored (bool), fixed (bool), autofixing (bool), fixedMsg (str)))
Up


codeStyleBatchCheck

codeStyleBatchCheck(argumentsList, send, fx, cancelled)

Module function to check code style for a batch of files.

argumentsList
list of arguments tuples as given for codeStyleCheck
send
reference to send function (function)
fx
registered service name (string)
cancelled
reference to function checking for a cancellation (function)
Up


codeStyleCheck

codeStyleCheck(filename, source, args)

Do the code style check and/ or fix found errors.

filename
source filename (string)
source
string containing the code to check (string)
args
arguments used by the codeStyleCheck function (list of excludeMessages (str), includeMessages (str), repeatMessages (bool), fixCodes (str), noFixCodes (str), fixIssues (bool), maxLineLength (int), hangClosing (bool), docType (str), errors (list of str), eol (str), encoding (str), backup (bool))
Returns:
tuple of stats (dict) and results (tuple for each found violation of style (tuple of lineno (int), position (int), text (str), ignored (bool), fixed (bool), autofixing (bool), fixedMsg (str)))
Up


extractLineFlags

extractLineFlags(line, startComment=")

Function to extract flags starting and ending with '__' from a line comment.

line
line to extract flags from (string)
startComment=
string identifying the start of the comment (string)
endComment=
string identifying the end of a comment (string)
Returns:
list containing the extracted flags (list of strings)
Up


initBatchService

initBatchService()

Initialize the batch service and return the entry point.

Returns:
the entry point for the background client (function)
Up


initService

initService()

Initialize the service and return the entry point.

Returns:
the entry point for the background client (function)
Up


worker

worker(input, output)

Module function acting as the parallel worker for the style check.

input
input queue (multiprocessing.Queue)
output
output queue (multiprocessing.Queue)
Up