eric7.Plugins.CheckerPlugins.DocStyleChecker.DocStyleCheckerDialog

Module implementing a dialog to configure the documentation style check and show its results.

Global Attributes

None

Classes

DocStyleCheckerDialog Class implementing a dialog to configure the documentation style check and show its results.

Functions

None


DocStyleCheckerDialog

Class implementing a dialog to configure the documentation style check and show its results.

Derived from

QDialog, Ui_DocStyleCheckerDialog

Class Attributes

argsRole
codeRole
filenameRole
fixableRole
hasResults
ignoredRole
lineRole
messageRole
noFiles
noResults
positionRole

Class Methods

None

Methods

DocStyleCheckerDialog Constructor
__batchFinished Private slot handling the completion of a batch job.
__clearErrors Private method to clear all warning markers of open editors to be checked.
__createErrorItem Private slot to create a new error item in the result list.
__createFileErrorItem Private method to create an error entry for a given file.
__createResultItem Private method to create an entry in the result list.
__defaultStatistics Private method to return the default statistics entry.
__finish Private slot called when the code style check finished or the user pressed the cancel button.
__getEol Private method to get the applicable eol string.
__getSelectedFixableItems Private method to extract all selected items for fixable issues.
__itemFixable Private method to check, if an item has a fixable issue.
__modifyFixedResultItem Private method to modify a result list entry to show its positive fixed state.
__prepareProgress Private method to prepare the progress tab for the next run.
__processError Private slot to process an error indication from the service.
__processResult Private slot called after perfoming a style check on one file.
__resetStatistics Private slot to reset the statistics data.
__resort Private method to resort the tree.
__selectCodes Private method to select message codes via a selection dialog.
__updateFixerStatistics Private method to update the collected fixer related statistics.
__updateProgress Private method to update the progress tab.
__updateStatistics Private method to update the collected statistics.
check Public method to start a style check for one file.
checkBatch Public method to start a style check batch job.
closeEvent Protected method to handle a close event.
getDefaults Public method to get a dictionary containing the default values.
on_buttonBox_clicked Private slot called by a button of the button box clicked.
on_cancelButton_clicked Private slot to handle the "Cancel" button press.
on_excludeMessagesSelectButton_clicked Private slot to select the message codes to be excluded via a selection dialog.
on_filterButton_clicked Private slot to filter the list of messages based on selected message code.
on_fixButton_clicked Private slot to fix selected issues.
on_fixIssuesSelectButton_clicked Private slot to select the issue codes to be fixed via a selection dialog.
on_includeMessagesSelectButton_clicked Private slot to select the message codes to be included via a selection dialog.
on_loadDefaultButton_clicked Private slot to load the default configuration values.
on_noFixIssuesSelectButton_clicked Private slot to select the issue codes not to be fixed via a selection dialog.
on_resetDefaultButton_clicked Private slot to reset the configuration values to their default values.
on_restartButton_clicked Private slot to restart a code style check run.
on_resultList_itemActivated Private slot to handle the activation of an item.
on_resultList_itemSelectionChanged Private slot to change the dialog state depending on the selection.
on_showButton_clicked Private slot to handle the "Show" button press.
on_startButton_clicked Private slot to start a documentation style check run.
on_statisticsButton_clicked Private slot to show the statistics dialog.
on_storeDefaultButton_clicked Private slot to store the current configuration values as default values.
prepare Public method to prepare the dialog with a list of filenames.
start Public slot to start the code style check.

Static Methods

None

DocStyleCheckerDialog (Constructor)

DocStyleCheckerDialog(styleCheckService, project=None, parent=None)

Constructor

styleCheckService (DocStyleCheckService)
reference to the service
project (Project)
reference to the project if called on project or project browser level
parent (QWidget)
reference to the parent widget

DocStyleCheckerDialog.__batchFinished

__batchFinished()

Private slot handling the completion of a batch job.

DocStyleCheckerDialog.__clearErrors

__clearErrors(files)

Private method to clear all warning markers of open editors to be checked.

files (list of str)
list of files to be checked

DocStyleCheckerDialog.__createErrorItem

__createErrorItem(filename, message)

Private slot to create a new error item in the result list.

filename (str)
name of the file
message (str)
error message

DocStyleCheckerDialog.__createFileErrorItem

__createFileErrorItem(filename, message)

Private method to create an error entry for a given file.

filename (str)
file name of the file
message (str)
error message text

DocStyleCheckerDialog.__createResultItem

__createResultItem(filename, result)

Private method to create an entry in the result list.

filename (str)
file name of the file
result (dict)
dictionary containing check result data
Return:
reference to the created item
Return Type:
QTreeWidgetItem

DocStyleCheckerDialog.__defaultStatistics

__defaultStatistics()

Private method to return the default statistics entry.

Return:
dictionary with default statistics entry
Return Type:
dict

DocStyleCheckerDialog.__finish

__finish()

Private slot called when the code style check finished or the user pressed the cancel button.

DocStyleCheckerDialog.__getEol

__getEol(fn)

Private method to get the applicable eol string.

fn (str)
filename where to determine the line ending
Return:
eol string
Return Type:
str

DocStyleCheckerDialog.__getSelectedFixableItems

__getSelectedFixableItems()

Private method to extract all selected items for fixable issues.

Return:
selected items for fixable issues
Return Type:
list of QTreeWidgetItem

DocStyleCheckerDialog.__itemFixable

__itemFixable(itm)

Private method to check, if an item has a fixable issue.

itm (QTreeWidgetItem)
item to be checked
Return:
flag indicating a fixable issue
Return Type:
bool

DocStyleCheckerDialog.__modifyFixedResultItem

__modifyFixedResultItem(itm, result)

Private method to modify a result list entry to show its positive fixed state.

itm (QTreeWidgetItem)
reference to the item to modify
result (dict)
dictionary containing check result data

DocStyleCheckerDialog.__prepareProgress

__prepareProgress()

Private method to prepare the progress tab for the next run.

DocStyleCheckerDialog.__processError

__processError(fn, msg)

Private slot to process an error indication from the service.

fn (str)
filename of the file
msg (str)
error message

DocStyleCheckerDialog.__processResult

__processResult(fn, docStyleCheckerStats, fixes, results)

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

fn (str)
filename of the just checked file
docStyleCheckerStats (dict)
stats of style and name check
fixes (int)
number of applied fixes
results (dict)
dictionary containing check result data

DocStyleCheckerDialog.__resetStatistics

__resetStatistics()

Private slot to reset the statistics data.

DocStyleCheckerDialog.__resort

__resort()

Private method to resort the tree.

DocStyleCheckerDialog.__selectCodes

__selectCodes(edit, showFixCodes)

Private method to select message codes via a selection dialog.

edit (QLineEdit)
reference of the line edit to be populated
showFixCodes (bool)
flag indicating to show a list of fixable issues

DocStyleCheckerDialog.__updateFixerStatistics

__updateFixerStatistics(fixer)

Private method to update the collected fixer related statistics.

fixer (DocStyleFixer)
reference to the code style fixer

DocStyleCheckerDialog.__updateProgress

__updateProgress(fn)

Private method to update the progress tab.

fn (str)
filename of the just checked file

DocStyleCheckerDialog.__updateStatistics

__updateStatistics(statisticData, fixer, ignoredErrors)

Private method to update the collected statistics.

statisticData (dict)
dictionary of statistical data with message code as key and message count as value
fixer (DocStyleFixer)
reference to the code style fixer
ignoredErrors (int)
number of ignored errors

DocStyleCheckerDialog.check

check(codestring="")

Public method to start a style check for one file.

The results are reported to the __processResult slot.

codestring (str)
optional sourcestring

DocStyleCheckerDialog.checkBatch

checkBatch()

Public method to start a style check batch job.

The results are reported to the __processResult slot.

DocStyleCheckerDialog.closeEvent

closeEvent(_evt)

Protected method to handle a close event.

_evt (QCloseEvent)
reference to the close event (unused)

DocStyleCheckerDialog.getDefaults

getDefaults()

Public method to get a dictionary containing the default values.

Return:
dictionary containing the default values
Return Type:
dict

DocStyleCheckerDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button (QAbstractButton)
button that was clicked

DocStyleCheckerDialog.on_cancelButton_clicked

on_cancelButton_clicked()

Private slot to handle the "Cancel" button press.

DocStyleCheckerDialog.on_excludeMessagesSelectButton_clicked

on_excludeMessagesSelectButton_clicked()

Private slot to select the message codes to be excluded via a selection dialog.

DocStyleCheckerDialog.on_filterButton_clicked

on_filterButton_clicked()

Private slot to filter the list of messages based on selected message code.

DocStyleCheckerDialog.on_fixButton_clicked

on_fixButton_clicked()

Private slot to fix selected issues.

Build a dictionary of issues to fix. Update the initialized __options. Then call check with the dict as keyparam to fix selected issues.

DocStyleCheckerDialog.on_fixIssuesSelectButton_clicked

on_fixIssuesSelectButton_clicked()

Private slot to select the issue codes to be fixed via a selection dialog.

DocStyleCheckerDialog.on_includeMessagesSelectButton_clicked

on_includeMessagesSelectButton_clicked()

Private slot to select the message codes to be included via a selection dialog.

DocStyleCheckerDialog.on_loadDefaultButton_clicked

on_loadDefaultButton_clicked()

Private slot to load the default configuration values.

DocStyleCheckerDialog.on_noFixIssuesSelectButton_clicked

on_noFixIssuesSelectButton_clicked()

Private slot to select the issue codes not to be fixed via a selection dialog.

DocStyleCheckerDialog.on_resetDefaultButton_clicked

on_resetDefaultButton_clicked()

Private slot to reset the configuration values to their default values.

DocStyleCheckerDialog.on_restartButton_clicked

on_restartButton_clicked()

Private slot to restart a code style check run.

DocStyleCheckerDialog.on_resultList_itemActivated

on_resultList_itemActivated(item, _column)

Private slot to handle the activation of an item.

item (QTreeWidgetItem)
reference to the activated item
_column (int)
column the item was activated in (unused)

DocStyleCheckerDialog.on_resultList_itemSelectionChanged

on_resultList_itemSelectionChanged()

Private slot to change the dialog state depending on the selection.

DocStyleCheckerDialog.on_showButton_clicked

on_showButton_clicked()

Private slot to handle the "Show" button press.

DocStyleCheckerDialog.on_startButton_clicked

on_startButton_clicked()

Private slot to start a documentation style check run.

DocStyleCheckerDialog.on_statisticsButton_clicked

on_statisticsButton_clicked()

Private slot to show the statistics dialog.

DocStyleCheckerDialog.on_storeDefaultButton_clicked

on_storeDefaultButton_clicked()

Private slot to store the current configuration values as default values.

DocStyleCheckerDialog.prepare

prepare(fileList, project)

Public method to prepare the dialog with a list of filenames.

fileList (list of str)
list of filenames
project (Project)
reference to the project object

DocStyleCheckerDialog.start

start(fn, save=False, repeat=None)

Public slot to start the code style check.

fn (str or list of str)
file or list of files or directory to be checked
save (bool)
flag indicating to save the given file/file list/directory
repeat (None or bool)
state of the repeat check box if it is not None
Up