eric6.Plugins.PluginCodeStyleChecker

Module implementing the code style checker plug-in.

Global Attributes

author
autoactivate
className
deactivateable
error
longDescription
name
packageName
pyqtApi
python2Compatible
shortDescription
version

Classes

CodeStyleCheckerPlugin Class implementing the code style checker plug-in.

Functions

None


CodeStyleCheckerPlugin

Class implementing the code style checker plug-in.

Signals

styleChecked(str, dict, int, list)
emited when the style check was done.

Derived from

QObject

Class Attributes

None

Class Methods

None

Methods

CodeStyleCheckerPlugin Constructor
__editorClosed Private slot called, when an editor was closed.
__editorCodeStyleCheck Private slot to handle the code style check context menu action of the editors.
__editorOpened Private slot called, when a new editor was opened.
__editorShowMenu Private slot called, when the the editor context menu or a submenu is about to be shown.
__initialize Private slot to (re)initialize the plugin.
__projectBrowserCodeStyleCheck Private method to handle the code style check context menu action of the project sources browser.
__projectBrowserShowMenu Private slot called, when the the project browser menu or a submenu is about to be shown.
__projectCodeStyleCheck Private slot used to check the project files for code style.
__projectShowMenu Private slot called, when the the project menu or a submenu is about to be shown.
__serviceError Private slot handling service errors.
__translateStyleCheck Private slot called after perfoming a style check on one file.
activate Public method to activate this plugin.
deactivate Public method to deactivate this plugin.
serviceErrorPy2 Public method handling service errors for Python 2.
serviceErrorPy3 Public method handling service errors for Python 2.
styleCheck Public method to prepare a style check on one Python source file.

Static Methods

None

CodeStyleCheckerPlugin (Constructor)

CodeStyleCheckerPlugin(ui)

Constructor

ui
reference to the user interface object (UI.UserInterface)

CodeStyleCheckerPlugin.__editorClosed

__editorClosed(editor)

Private slot called, when an editor was closed.

editor
reference to the editor (QScintilla.Editor)

CodeStyleCheckerPlugin.__editorCodeStyleCheck

__editorCodeStyleCheck()

Private slot to handle the code style check context menu action of the editors.

CodeStyleCheckerPlugin.__editorOpened

__editorOpened(editor)

Private slot called, when a new editor was opened.

editor
reference to the new editor (QScintilla.Editor)

CodeStyleCheckerPlugin.__editorShowMenu

__editorShowMenu(menuName, menu, editor)

Private slot called, when the the editor context menu or a submenu is about to be shown.

menuName
name of the menu to be shown (string)
menu
reference to the menu (QMenu)
editor
reference to the editor

CodeStyleCheckerPlugin.__initialize

__initialize()

Private slot to (re)initialize the plugin.

CodeStyleCheckerPlugin.__projectBrowserCodeStyleCheck

__projectBrowserCodeStyleCheck()

Private method to handle the code style check context menu action of the project sources browser.

CodeStyleCheckerPlugin.__projectBrowserShowMenu

__projectBrowserShowMenu(menuName, menu)

Private slot called, when the the project browser menu or a submenu is about to be shown.

menuName
name of the menu to be shown (string)
menu
reference to the menu (QMenu)

CodeStyleCheckerPlugin.__projectCodeStyleCheck

__projectCodeStyleCheck()

Private slot used to check the project files for code style.

CodeStyleCheckerPlugin.__projectShowMenu

__projectShowMenu(menuName, menu)

Private slot called, when the the project menu or a submenu is about to be shown.

menuName
name of the menu to be shown (string)
menu
reference to the menu (QMenu)

CodeStyleCheckerPlugin.__serviceError

__serviceError(fn, msg)

Private slot handling service errors.

fn
file name (string)
msg
message text (string)

CodeStyleCheckerPlugin.__translateStyleCheck

__translateStyleCheck(fn, codeStyleCheckerStats, results)

Private slot called after perfoming a style check on one file.

fn
filename of the just checked file (str)
codeStyleCheckerStats
stats of style and name check (dict)
results
tuple for each found violation of style (tuple of lineno (int), position (int), text (str), fixed (bool), autofixing (bool), fixedMsg (str))

CodeStyleCheckerPlugin.activate

activate()

Public method to activate this plugin.

Returns:
tuple of None and activation status (boolean)

CodeStyleCheckerPlugin.deactivate

deactivate()

Public method to deactivate this plugin.

CodeStyleCheckerPlugin.serviceErrorPy2

serviceErrorPy2(fx, lang, fn, msg)

Public method handling service errors for Python 2.

fx
service name (string)
lang
language (string)
fn
file name (string)
msg
message text (string)

CodeStyleCheckerPlugin.serviceErrorPy3

serviceErrorPy3(fx, lang, fn, msg)

Public method handling service errors for Python 2.

fx
service name (string)
lang
language (string)
fn
file name (string)
msg
message text (string)

CodeStyleCheckerPlugin.styleCheck

styleCheck(lang, filename, source, args)

Public method to prepare a style check on one Python source file.

lang
language of the file or None to determine by internal algorithm (str or None)
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))
Up