Added a checker for string format strings.

Thu, 29 Oct 2015 19:06:49 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 29 Oct 2015 19:06:49 +0100
changeset 4511
b5e4e7efa904
parent 4510
43437fc9f4c9
child 4512
23e8b848efb0

Added a checker for string format strings.

APIs/Python3/eric6.api file | annotate | diff | comparison | revisions
APIs/Python3/eric6.bas file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html file | annotate | diff | comparison | revisions
Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html file | annotate | diff | comparison | revisions
Documentation/Source/index-eric6.Plugins.CheckerPlugins.CodeStyleChecker.html file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCodeSelectionDialog.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/translations.py file | annotate | diff | comparison | revisions
eric6.e4p file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric6.api	Wed Oct 28 20:15:46 2015 +0100
+++ b/APIs/Python3/eric6.api	Thu Oct 29 19:06:49 2015 +0100
@@ -3954,6 +3954,7 @@
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.initBatchService?4()
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.initService?4()
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.worker?4(input, output)
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog.availableFutures?7
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog.check?4(codestring='')
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog.checkBatch?4()
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog.codeRole?7
@@ -4012,6 +4013,18 @@
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.McCabeChecker.McCabeChecker.Codes?7
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.McCabeChecker.McCabeChecker.run?4()
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.McCabeChecker.McCabeChecker?1(source, filename, select, ignore, maxComplexity=10)
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.MiscellaneousChecker.Codes?7
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.MiscellaneousChecker.FormatFieldRegex?7
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.MiscellaneousChecker.Formatter?7
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.MiscellaneousChecker.run?4()
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.MiscellaneousChecker?1(source, filename, select, ignore, expected, repeat, args)
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.TextVisitor.visit_Bytes?4(node)
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.TextVisitor.visit_Call?4(node)
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.TextVisitor.visit_ClassDef?4(node)
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.TextVisitor.visit_FunctionDef?4(node)
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.TextVisitor.visit_Module?4(node)
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.TextVisitor.visit_Str?4(node)
+eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.TextVisitor?1()
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.CamelcaseRegexp?7
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.Codes?7
 eric6.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.LowercaseRegex?7
--- a/APIs/Python3/eric6.bas	Wed Oct 28 20:15:46 2015 +0100
+++ b/APIs/Python3/eric6.bas	Thu Oct 29 19:06:49 2015 +0100
@@ -739,6 +739,7 @@
 TemplatesPage ConfigurationPageBase Ui_TemplatesPage
 TemplatesReader XMLStreamReaderBase
 TemplatesWriter XMLStreamWriterBase
+TextVisitor ast.NodeVisitor
 Token str
 ToolConfigurationDialog QDialog Ui_ToolConfigurationDialog
 ToolGroupConfigurationDialog QDialog Ui_ToolGroupConfigurationDialog
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Wed Oct 28 20:15:46 2015 +0100
+++ b/Documentation/Help/source.qhp	Thu Oct 29 19:06:49 2015 +0100
@@ -490,6 +490,7 @@
                 <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleStatisticsDialog" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleStatisticsDialog.html" />
                 <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html" />
                 <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.McCabeChecker" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.McCabeChecker.html" />
+                <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html" />
                 <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html" />
                 <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.mccabe" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.mccabe.html" />
                 <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.pep8" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html" />
@@ -2187,6 +2188,8 @@
       <keyword name="CodeStyleCheckerDialog.__finish" id="CodeStyleCheckerDialog.__finish" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__finish" />
       <keyword name="CodeStyleCheckerDialog.__getEol" id="CodeStyleCheckerDialog.__getEol" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__getEol" />
       <keyword name="CodeStyleCheckerDialog.__getSelectedFixableItems" id="CodeStyleCheckerDialog.__getSelectedFixableItems" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__getSelectedFixableItems" />
+      <keyword name="CodeStyleCheckerDialog.__getSelectedFutureImports" id="CodeStyleCheckerDialog.__getSelectedFutureImports" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__getSelectedFutureImports" />
+      <keyword name="CodeStyleCheckerDialog.__initFuturesList" id="CodeStyleCheckerDialog.__initFuturesList" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__initFuturesList" />
       <keyword name="CodeStyleCheckerDialog.__itemFixable" id="CodeStyleCheckerDialog.__itemFixable" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__itemFixable" />
       <keyword name="CodeStyleCheckerDialog.__modifyFixedResultItem" id="CodeStyleCheckerDialog.__modifyFixedResultItem" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__modifyFixedResultItem" />
       <keyword name="CodeStyleCheckerDialog.__processError" id="CodeStyleCheckerDialog.__processError" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__processError" />
@@ -8132,6 +8135,22 @@
       <keyword name="MiniScintilla.focusInEvent" id="MiniScintilla.focusInEvent" ref="eric6.QScintilla.MiniEditor.html#MiniScintilla.focusInEvent" />
       <keyword name="MiniScintilla.focusOutEvent" id="MiniScintilla.focusOutEvent" ref="eric6.QScintilla.MiniEditor.html#MiniScintilla.focusOutEvent" />
       <keyword name="MiniScintilla.getFileName" id="MiniScintilla.getFileName" ref="eric6.QScintilla.MiniEditor.html#MiniScintilla.getFileName" />
+      <keyword name="MiscellaneousChecker" id="MiscellaneousChecker" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker" />
+      <keyword name="MiscellaneousChecker (Constructor)" id="MiscellaneousChecker (Constructor)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__init__" />
+      <keyword name="MiscellaneousChecker (Module)" id="MiscellaneousChecker (Module)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html" />
+      <keyword name="MiscellaneousChecker.__checkBlindExcept" id="MiscellaneousChecker.__checkBlindExcept" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__checkBlindExcept" />
+      <keyword name="MiscellaneousChecker.__checkCoding" id="MiscellaneousChecker.__checkCoding" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__checkCoding" />
+      <keyword name="MiscellaneousChecker.__checkCopyright" id="MiscellaneousChecker.__checkCopyright" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__checkCopyright" />
+      <keyword name="MiscellaneousChecker.__checkFormatString" id="MiscellaneousChecker.__checkFormatString" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__checkFormatString" />
+      <keyword name="MiscellaneousChecker.__checkFuture" id="MiscellaneousChecker.__checkFuture" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__checkFuture" />
+      <keyword name="MiscellaneousChecker.__checkPep3101" id="MiscellaneousChecker.__checkPep3101" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__checkPep3101" />
+      <keyword name="MiscellaneousChecker.__checkPrintStatements" id="MiscellaneousChecker.__checkPrintStatements" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__checkPrintStatements" />
+      <keyword name="MiscellaneousChecker.__checkTuple" id="MiscellaneousChecker.__checkTuple" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__checkTuple" />
+      <keyword name="MiscellaneousChecker.__error" id="MiscellaneousChecker.__error" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__error" />
+      <keyword name="MiscellaneousChecker.__getFields" id="MiscellaneousChecker.__getFields" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__getFields" />
+      <keyword name="MiscellaneousChecker.__ignoreCode" id="MiscellaneousChecker.__ignoreCode" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__ignoreCode" />
+      <keyword name="MiscellaneousChecker.__reportInvalidSyntax" id="MiscellaneousChecker.__reportInvalidSyntax" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.__reportInvalidSyntax" />
+      <keyword name="MiscellaneousChecker.run" id="MiscellaneousChecker.run" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#MiscellaneousChecker.run" />
       <keyword name="Module" id="Module" ref="eric6.Utilities.ClassBrowsers.ClbrBaseClasses.html#Module" />
       <keyword name="Module" id="Module" ref="eric6.Utilities.ClassBrowsers.idlclbr.html#Module" />
       <keyword name="Module" id="Module" ref="eric6.Utilities.ClassBrowsers.rbclbr.html#Module" />
@@ -12091,6 +12110,18 @@
       <keyword name="TemplatesWriter (Constructor)" id="TemplatesWriter (Constructor)" ref="eric6.E5XML.TemplatesWriter.html#TemplatesWriter.__init__" />
       <keyword name="TemplatesWriter (Module)" id="TemplatesWriter (Module)" ref="eric6.E5XML.TemplatesWriter.html" />
       <keyword name="TemplatesWriter.writeXML" id="TemplatesWriter.writeXML" ref="eric6.E5XML.TemplatesWriter.html#TemplatesWriter.writeXML" />
+      <keyword name="TextVisitor" id="TextVisitor" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor" />
+      <keyword name="TextVisitor (Constructor)" id="TextVisitor (Constructor)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor.__init__" />
+      <keyword name="TextVisitor.__addNode" id="TextVisitor.__addNode" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor.__addNode" />
+      <keyword name="TextVisitor.__isBaseString" id="TextVisitor.__isBaseString" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor.__isBaseString" />
+      <keyword name="TextVisitor.__visitBody" id="TextVisitor.__visitBody" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor.__visitBody" />
+      <keyword name="TextVisitor.__visitDefinition" id="TextVisitor.__visitDefinition" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor.__visitDefinition" />
+      <keyword name="TextVisitor.visit_Bytes" id="TextVisitor.visit_Bytes" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor.visit_Bytes" />
+      <keyword name="TextVisitor.visit_Call" id="TextVisitor.visit_Call" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor.visit_Call" />
+      <keyword name="TextVisitor.visit_ClassDef" id="TextVisitor.visit_ClassDef" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor.visit_ClassDef" />
+      <keyword name="TextVisitor.visit_FunctionDef" id="TextVisitor.visit_FunctionDef" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor.visit_FunctionDef" />
+      <keyword name="TextVisitor.visit_Module" id="TextVisitor.visit_Module" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor.visit_Module" />
+      <keyword name="TextVisitor.visit_Str" id="TextVisitor.visit_Str" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html#TextVisitor.visit_Str" />
       <keyword name="Token" id="Token" ref="eric6.DataViews.CodeMetrics.html#Token" />
       <keyword name="Token" id="Token" ref="eric6.E5Network.E5RFC6266.html#Token" />
       <keyword name="Token (Constructor)" id="Token (Constructor)" ref="eric6.DataViews.CodeMetrics.html#Token.__init__" />
@@ -14449,6 +14480,7 @@
       <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleStatisticsDialog.html</file>
       <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html</file>
       <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.McCabeChecker.html</file>
+      <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html</file>
       <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html</file>
       <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.mccabe.html</file>
       <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html</file>
--- a/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html	Wed Oct 28 20:15:46 2015 +0100
+++ b/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html	Thu Oct 29 19:06:49 2015 +0100
@@ -48,7 +48,7 @@
 QDialog, Ui_CodeStyleCheckerDialog
 <h3>Class Attributes</h3>
 <table>
-<tr><td>codeRole</td></tr><tr><td>filenameRole</td></tr><tr><td>fixableRole</td></tr><tr><td>ignoredRole</td></tr><tr><td>lineRole</td></tr><tr><td>messageRole</td></tr><tr><td>positionRole</td></tr>
+<tr><td>availableFutures</td></tr><tr><td>codeRole</td></tr><tr><td>filenameRole</td></tr><tr><td>fixableRole</td></tr><tr><td>ignoredRole</td></tr><tr><td>lineRole</td></tr><tr><td>messageRole</td></tr><tr><td>positionRole</td></tr>
 </table>
 <h3>Class Methods</h3>
 <table>
@@ -81,6 +81,12 @@
 <td><a href="#CodeStyleCheckerDialog.__getSelectedFixableItems">__getSelectedFixableItems</a></td>
 <td>Private method to extract all selected items for fixable issues.</td>
 </tr><tr>
+<td><a href="#CodeStyleCheckerDialog.__getSelectedFutureImports">__getSelectedFutureImports</a></td>
+<td>Private method to get the expected future imports.</td>
+</tr><tr>
+<td><a href="#CodeStyleCheckerDialog.__initFuturesList">__initFuturesList</a></td>
+<td>Private method to set the selected status of the future imports.</td>
+</tr><tr>
 <td><a href="#CodeStyleCheckerDialog.__itemFixable">__itemFixable</a></td>
 <td>Private method to check, if an item has a fixable issue.</td>
 </tr><tr>
@@ -275,6 +281,31 @@
 <dd>
 selected items for fixable issues (list of QTreeWidgetItem)
 </dd>
+</dl><a NAME="CodeStyleCheckerDialog.__getSelectedFutureImports" ID="CodeStyleCheckerDialog.__getSelectedFutureImports"></a>
+<h4>CodeStyleCheckerDialog.__getSelectedFutureImports</h4>
+<b>__getSelectedFutureImports</b>(<i></i>)
+<p>
+        Private method to get the expected future imports.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+expected future imports as a comma separated string
+</dd>
+</dl><dl>
+<dt>Return Type:</dt>
+<dd>
+str
+</dd>
+</dl><a NAME="CodeStyleCheckerDialog.__initFuturesList" ID="CodeStyleCheckerDialog.__initFuturesList"></a>
+<h4>CodeStyleCheckerDialog.__initFuturesList</h4>
+<b>__initFuturesList</b>(<i>selectedFutures</i>)
+<p>
+        Private method to set the selected status of the future imports.
+</p><dl>
+<dt><i>selectedFutures</i> (str)</dt>
+<dd>
+comma separated list of expected future imports
+</dd>
 </dl><a NAME="CodeStyleCheckerDialog.__itemFixable" ID="CodeStyleCheckerDialog.__itemFixable"></a>
 <h4>CodeStyleCheckerDialog.__itemFixable</h4>
 <b>__itemFixable</b>(<i>itm</i>)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html	Thu Oct 29 19:06:49 2015 +0100
@@ -0,0 +1,433 @@
+<!DOCTYPE html>
+<html><head>
+<title>eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker</title>
+<meta charset="UTF-8">
+<style>
+body {
+    background: #EDECE6;
+    margin: 0em 1em 10em 1em;
+    color: black;
+}
+
+h1 { color: white; background: #85774A; }
+h2 { color: white; background: #85774A; }
+h3 { color: white; background: #9D936E; }
+h4 { color: white; background: #9D936E; }
+    
+a { color: #BA6D36; }
+
+</style>
+</head>
+<body><a NAME="top" ID="top"></a>
+<h1>eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker</h1>
+<p>
+Module implementing a checker for miscellaneous checks.
+</p>
+<h3>Global Attributes</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Classes</h3>
+<table>
+<tr>
+<td><a href="#MiscellaneousChecker">MiscellaneousChecker</a></td>
+<td>Class implementing a checker for miscellaneous checks.</td>
+</tr><tr>
+<td><a href="#TextVisitor">TextVisitor</a></td>
+<td>Class implementing a node visitor for bytes and str instances.</td>
+</tr>
+</table>
+<h3>Functions</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<hr /><hr />
+<a NAME="MiscellaneousChecker" ID="MiscellaneousChecker"></a>
+<h2>MiscellaneousChecker</h2>
+<p>
+    Class implementing a checker for miscellaneous checks.
+</p>
+<h3>Derived from</h3>
+object
+<h3>Class Attributes</h3>
+<table>
+<tr><td>Codes</td></tr><tr><td>FormatFieldRegex</td></tr><tr><td>Formatter</td></tr>
+</table>
+<h3>Class Methods</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Methods</h3>
+<table>
+<tr>
+<td><a href="#MiscellaneousChecker.__init__">MiscellaneousChecker</a></td>
+<td>Constructor</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__checkBlindExcept">__checkBlindExcept</a></td>
+<td>Private method to check for blind except statements.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__checkCoding">__checkCoding</a></td>
+<td>Private method to check the presence of a coding line and valid encodings.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__checkCopyright">__checkCopyright</a></td>
+<td>Private method to check the presence of a copyright statement.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__checkFormatString">__checkFormatString</a></td>
+<td>Private method to check string format strings.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__checkFuture">__checkFuture</a></td>
+<td>Private method to check the __future__ imports.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__checkPep3101">__checkPep3101</a></td>
+<td>Private method to check for old style string formatting.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__checkPrintStatements">__checkPrintStatements</a></td>
+<td>Private method to check for print statements.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__checkTuple">__checkTuple</a></td>
+<td>Private method to check for one element tuples.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__error">__error</a></td>
+<td>Private method to record an issue.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__getFields">__getFields</a></td>
+<td>Private method to extract the format field information.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__ignoreCode">__ignoreCode</a></td>
+<td>Private method to check if the message code should be ignored.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.__reportInvalidSyntax">__reportInvalidSyntax</a></td>
+<td>Private method to report a syntax error.</td>
+</tr><tr>
+<td><a href="#MiscellaneousChecker.run">run</a></td>
+<td>Public method to check the given source against miscellaneous conditions.</td>
+</tr>
+</table>
+<h3>Static Methods</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<a NAME="MiscellaneousChecker.__init__" ID="MiscellaneousChecker.__init__"></a>
+<h4>MiscellaneousChecker (Constructor)</h4>
+<b>MiscellaneousChecker</b>(<i>source, filename, select, ignore, expected, repeat, args</i>)
+<p>
+        Constructor
+</p><dl>
+<dt><i>source</i> (list of str)</dt>
+<dd>
+source code to be checked
+</dd><dt><i>filename</i> (str)</dt>
+<dd>
+name of the source file
+</dd><dt><i>select</i> (list of str)</dt>
+<dd>
+list of selected codes
+</dd><dt><i>ignore</i> (list of str)</dt>
+<dd>
+list of codes to be ignored
+</dd><dt><i>expected</i> (list of str)</dt>
+<dd>
+list of expected codes
+</dd><dt><i>repeat</i> (bool)</dt>
+<dd>
+flag indicating to report each occurrence of a code
+</dd><dt><i>args</i> (dict)</dt>
+<dd>
+dictionary of arguments for the miscellaneous checks
+</dd>
+</dl><a NAME="MiscellaneousChecker.__checkBlindExcept" ID="MiscellaneousChecker.__checkBlindExcept"></a>
+<h4>MiscellaneousChecker.__checkBlindExcept</h4>
+<b>__checkBlindExcept</b>(<i></i>)
+<p>
+        Private method to check for blind except statements.
+</p><a NAME="MiscellaneousChecker.__checkCoding" ID="MiscellaneousChecker.__checkCoding"></a>
+<h4>MiscellaneousChecker.__checkCoding</h4>
+<b>__checkCoding</b>(<i></i>)
+<p>
+        Private method to check the presence of a coding line and valid
+        encodings.
+</p><a NAME="MiscellaneousChecker.__checkCopyright" ID="MiscellaneousChecker.__checkCopyright"></a>
+<h4>MiscellaneousChecker.__checkCopyright</h4>
+<b>__checkCopyright</b>(<i></i>)
+<p>
+        Private method to check the presence of a copyright statement.
+</p><a NAME="MiscellaneousChecker.__checkFormatString" ID="MiscellaneousChecker.__checkFormatString"></a>
+<h4>MiscellaneousChecker.__checkFormatString</h4>
+<b>__checkFormatString</b>(<i></i>)
+<p>
+        Private method to check string format strings.
+</p><a NAME="MiscellaneousChecker.__checkFuture" ID="MiscellaneousChecker.__checkFuture"></a>
+<h4>MiscellaneousChecker.__checkFuture</h4>
+<b>__checkFuture</b>(<i></i>)
+<p>
+        Private method to check the __future__ imports.
+</p><a NAME="MiscellaneousChecker.__checkPep3101" ID="MiscellaneousChecker.__checkPep3101"></a>
+<h4>MiscellaneousChecker.__checkPep3101</h4>
+<b>__checkPep3101</b>(<i></i>)
+<p>
+        Private method to check for old style string formatting.
+</p><a NAME="MiscellaneousChecker.__checkPrintStatements" ID="MiscellaneousChecker.__checkPrintStatements"></a>
+<h4>MiscellaneousChecker.__checkPrintStatements</h4>
+<b>__checkPrintStatements</b>(<i></i>)
+<p>
+        Private method to check for print statements.
+</p><a NAME="MiscellaneousChecker.__checkTuple" ID="MiscellaneousChecker.__checkTuple"></a>
+<h4>MiscellaneousChecker.__checkTuple</h4>
+<b>__checkTuple</b>(<i></i>)
+<p>
+        Private method to check for one element tuples.
+</p><a NAME="MiscellaneousChecker.__error" ID="MiscellaneousChecker.__error"></a>
+<h4>MiscellaneousChecker.__error</h4>
+<b>__error</b>(<i>lineNumber, offset, code, *args</i>)
+<p>
+        Private method to record an issue.
+</p><dl>
+<dt><i>lineNumber</i> (int)</dt>
+<dd>
+line number of the issue
+</dd><dt><i>offset</i> (int)</dt>
+<dd>
+position within line of the issue
+</dd><dt><i>code</i> (str)</dt>
+<dd>
+message code
+</dd><dt><i>args</i> (list)</dt>
+<dd>
+arguments for the message
+</dd>
+</dl><a NAME="MiscellaneousChecker.__getFields" ID="MiscellaneousChecker.__getFields"></a>
+<h4>MiscellaneousChecker.__getFields</h4>
+<b>__getFields</b>(<i>string</i>)
+<p>
+        Private method to extract the format field information.
+</p><dl>
+<dt><i>string</i> (str)</dt>
+<dd>
+format string to be parsed
+</dd>
+</dl><dl>
+<dt>Returns:</dt>
+<dd>
+format field information as a tuple with fields, implicit
+            field definitions present and explicit field definitions present
+</dd>
+</dl><dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of set of str, bool, bool
+</dd>
+</dl><a NAME="MiscellaneousChecker.__ignoreCode" ID="MiscellaneousChecker.__ignoreCode"></a>
+<h4>MiscellaneousChecker.__ignoreCode</h4>
+<b>__ignoreCode</b>(<i>code</i>)
+<p>
+        Private method to check if the message code should be ignored.
+</p><dl>
+<dt><i>code</i> (str)</dt>
+<dd>
+message code to check for
+</dd>
+</dl><dl>
+<dt>Returns:</dt>
+<dd>
+flag indicating to ignore the given code
+</dd>
+</dl><dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl><a NAME="MiscellaneousChecker.__reportInvalidSyntax" ID="MiscellaneousChecker.__reportInvalidSyntax"></a>
+<h4>MiscellaneousChecker.__reportInvalidSyntax</h4>
+<b>__reportInvalidSyntax</b>(<i></i>)
+<p>
+        Private method to report a syntax error.
+</p><a NAME="MiscellaneousChecker.run" ID="MiscellaneousChecker.run"></a>
+<h4>MiscellaneousChecker.run</h4>
+<b>run</b>(<i></i>)
+<p>
+        Public method to check the given source against miscellaneous
+        conditions.
+</p>
+<div align="right"><a href="#top">Up</a></div>
+<hr /><hr />
+<a NAME="TextVisitor" ID="TextVisitor"></a>
+<h2>TextVisitor</h2>
+<p>
+    Class implementing a node visitor for bytes and str instances.
+</p><p>
+    It tries to detect docstrings as string of the first expression of each
+    module, class or function.
+</p>
+<h3>Derived from</h3>
+ast.NodeVisitor
+<h3>Class Attributes</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Class Methods</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Methods</h3>
+<table>
+<tr>
+<td><a href="#TextVisitor.__init__">TextVisitor</a></td>
+<td>Constructor</td>
+</tr><tr>
+<td><a href="#TextVisitor.__addNode">__addNode</a></td>
+<td>Private method to add a node to our list of nodes.</td>
+</tr><tr>
+<td><a href="#TextVisitor.__isBaseString">__isBaseString</a></td>
+<td>Private method to determine, if a node is a base string node.</td>
+</tr><tr>
+<td><a href="#TextVisitor.__visitBody">__visitBody</a></td>
+<td>Private method to traverse the body of the node manually.</td>
+</tr><tr>
+<td><a href="#TextVisitor.__visitDefinition">__visitDefinition</a></td>
+<td>Private method handling class and function definitions.</td>
+</tr><tr>
+<td><a href="#TextVisitor.visit_Bytes">visit_Bytes</a></td>
+<td>Public method to record a bytes node.</td>
+</tr><tr>
+<td><a href="#TextVisitor.visit_Call">visit_Call</a></td>
+<td>Public method to handle a function call.</td>
+</tr><tr>
+<td><a href="#TextVisitor.visit_ClassDef">visit_ClassDef</a></td>
+<td>Public method to handle a class definition.</td>
+</tr><tr>
+<td><a href="#TextVisitor.visit_FunctionDef">visit_FunctionDef</a></td>
+<td>Public method to handle a function definition.</td>
+</tr><tr>
+<td><a href="#TextVisitor.visit_Module">visit_Module</a></td>
+<td>Public method to handle a module.</td>
+</tr><tr>
+<td><a href="#TextVisitor.visit_Str">visit_Str</a></td>
+<td>Public method to record a string node.</td>
+</tr>
+</table>
+<h3>Static Methods</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<a NAME="TextVisitor.__init__" ID="TextVisitor.__init__"></a>
+<h4>TextVisitor (Constructor)</h4>
+<b>TextVisitor</b>(<i></i>)
+<p>
+        Constructor
+</p><a NAME="TextVisitor.__addNode" ID="TextVisitor.__addNode"></a>
+<h4>TextVisitor.__addNode</h4>
+<b>__addNode</b>(<i>node</i>)
+<p>
+        Private method to add a node to our list of nodes.
+</p><dl>
+<dt><i>node</i> (ast.AST)</dt>
+<dd>
+reference to the node to add
+</dd>
+</dl><a NAME="TextVisitor.__isBaseString" ID="TextVisitor.__isBaseString"></a>
+<h4>TextVisitor.__isBaseString</h4>
+<b>__isBaseString</b>(<i>node</i>)
+<p>
+        Private method to determine, if a node is a base string node.
+</p><dl>
+<dt><i>node</i> (ast.AST)</dt>
+<dd>
+reference to the node to check
+</dd>
+</dl><dl>
+<dt>Returns:</dt>
+<dd>
+flag indicating a base string
+</dd>
+</dl><dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl><a NAME="TextVisitor.__visitBody" ID="TextVisitor.__visitBody"></a>
+<h4>TextVisitor.__visitBody</h4>
+<b>__visitBody</b>(<i>node</i>)
+<p>
+        Private method to traverse the body of the node manually.
+</p><p>
+        If the first node is an expression which contains a string or bytes it
+        marks that as a docstring.
+</p><dl>
+<dt><i>node</i> (ast.AST)</dt>
+<dd>
+reference to the node to traverse
+</dd>
+</dl><a NAME="TextVisitor.__visitDefinition" ID="TextVisitor.__visitDefinition"></a>
+<h4>TextVisitor.__visitDefinition</h4>
+<b>__visitDefinition</b>(<i>node</i>)
+<p>
+        Private method handling class and function definitions.
+</p><dl>
+<dt><i>node</i> (ast.FunctionDef or ast.ClassDef)</dt>
+<dd>
+reference to the node to handle
+</dd>
+</dl><a NAME="TextVisitor.visit_Bytes" ID="TextVisitor.visit_Bytes"></a>
+<h4>TextVisitor.visit_Bytes</h4>
+<b>visit_Bytes</b>(<i>node</i>)
+<p>
+        Public method to record a bytes node.
+</p><dl>
+<dt><i>node</i> (ast.Bytes)</dt>
+<dd>
+reference to the bytes node
+</dd>
+</dl><a NAME="TextVisitor.visit_Call" ID="TextVisitor.visit_Call"></a>
+<h4>TextVisitor.visit_Call</h4>
+<b>visit_Call</b>(<i>node</i>)
+<p>
+        Public method to handle a function call.
+</p><dl>
+<dt><i>node</i> (ast.Call)</dt>
+<dd>
+reference to the node to handle
+</dd>
+</dl><a NAME="TextVisitor.visit_ClassDef" ID="TextVisitor.visit_ClassDef"></a>
+<h4>TextVisitor.visit_ClassDef</h4>
+<b>visit_ClassDef</b>(<i>node</i>)
+<p>
+        Public method to handle a class definition.
+</p><dl>
+<dt><i>node</i> (ast.ClassDef)</dt>
+<dd>
+reference to the node to handle
+</dd>
+</dl><a NAME="TextVisitor.visit_FunctionDef" ID="TextVisitor.visit_FunctionDef"></a>
+<h4>TextVisitor.visit_FunctionDef</h4>
+<b>visit_FunctionDef</b>(<i>node</i>)
+<p>
+        Public method to handle a function definition.
+</p><dl>
+<dt><i>node</i> (ast.FunctionDef)</dt>
+<dd>
+reference to the node to handle
+</dd>
+</dl><a NAME="TextVisitor.visit_Module" ID="TextVisitor.visit_Module"></a>
+<h4>TextVisitor.visit_Module</h4>
+<b>visit_Module</b>(<i>node</i>)
+<p>
+        Public method to handle a module.
+</p><dl>
+<dt><i>node</i> (ast.Module)</dt>
+<dd>
+reference to the node to handle
+</dd>
+</dl><a NAME="TextVisitor.visit_Str" ID="TextVisitor.visit_Str"></a>
+<h4>TextVisitor.visit_Str</h4>
+<b>visit_Str</b>(<i>node</i>)
+<p>
+        Public method to record a string node.
+</p><dl>
+<dt><i>node</i> (ast.Str)</dt>
+<dd>
+reference to the string node
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+</body></html>
\ No newline at end of file
--- a/Documentation/Source/index-eric6.Plugins.CheckerPlugins.CodeStyleChecker.html	Wed Oct 28 20:15:46 2015 +0100
+++ b/Documentation/Source/index-eric6.Plugins.CheckerPlugins.CodeStyleChecker.html	Thu Oct 29 19:06:49 2015 +0100
@@ -49,6 +49,9 @@
 <td><a href="eric6.Plugins.CheckerPlugins.CodeStyleChecker.McCabeChecker.html">McCabeChecker</a></td>
 <td>Module implementing a checker for code complexity.</td>
 </tr><tr>
+<td><a href="eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html">MiscellaneousChecker</a></td>
+<td>Module implementing a checker for miscellaneous checks.</td>
+</tr><tr>
 <td><a href="eric6.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html">NamingStyleChecker</a></td>
 <td>Module implementing a checker for naming conventions.</td>
 </tr><tr>
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCodeSelectionDialog.py	Wed Oct 28 20:15:46 2015 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCodeSelectionDialog.py	Thu Oct 29 19:06:49 2015 +0100
@@ -32,6 +32,7 @@
         super(CodeStyleCodeSelectionDialog, self).__init__(parent)
         self.setupUi(self)
         
+        self.codeTable.headerItem().setText(self.codeTable.columnCount(), "")
         codeList = [code.strip() for code in codes.split(",") if code.strip()]
         
         from .translations import _messages, _messages_sample_args
@@ -61,6 +62,9 @@
             if code in codeList:
                 itm.setSelected(True)
                 codeList.remove(code)
+        self.codeTable.resizeColumnToContents(0)
+        self.codeTable.resizeColumnToContents(1)
+        self.codeTable.header().setStretchLastSection(True)
         
         self.__extraCodes = codeList[:]
     
--- a/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py	Wed Oct 28 20:15:46 2015 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py	Thu Oct 29 19:06:49 2015 +0100
@@ -12,6 +12,8 @@
 import sys
 import ast
 import re
+import itertools
+from string import Formatter
 
 
 class MiscellaneousChecker(object):
@@ -22,13 +24,22 @@
         "M101", "M102",
         "M111", "M112",
         "M121",
-        "M131",
+        
+        "M601",
+        "M611", "M612", "M613",
+        "M621", "M622", "M623", "M624", "M625",
+        "M631", "M632",
+        
         "M701", "M702",
+        
         "M801",
         "M811",
         
         "M901",
     ]
+    
+    Formatter = Formatter()
+    FormatFieldRegex = re.compile(r'^((?:\s|.)*?)(\..*|\[.*\])?$')
 
     def __init__(self, source, filename, select, ignore, expected, repeat,
                  args):
@@ -70,14 +81,16 @@
         self.errors = []
         
         checkersWithCodes = [
-            # TODO: fill this
             (self.__checkCoding, ("M101", "M102")),
             (self.__checkCopyright, ("M111", "M112")),
             (self.__checkBlindExcept, ("M121",)),
-            (self.__checkPep3101, ("M131",)),
+            (self.__checkPep3101, ("M601",)),
+            (self.__checkFormatString, ("M611", "M612", "M613",
+                                        "M621", "M622", "M623", "M624", "M625",
+                                        "M631", "M632")),
+            (self.__checkFuture, ("M701", "M702")),
             (self.__checkPrintStatements, ("M801",)),
             (self.__checkTuple, ("M811", )),
-            (self.__checkFuture, ("M701", "M702")),
         ]
         
         self.__defaultArgs = {
@@ -244,29 +257,6 @@
             if match:
                 self.__error(lineno, match.start(), "M121")
     
-    def __checkPep3101(self):
-        """
-        Private method to check for old style string formatting.
-        """
-        for lineno, line in enumerate(self.__source):
-            match = self.__pep3101FormatRegex.search(line)
-            if match:
-                lineLen = len(line)
-                pos = line.find('%')
-                formatPos = pos
-                formatter = '%'
-                if line[pos + 1] == "(":
-                    pos = line.find(")", pos)
-                c = line[pos]
-                while c not in "diouxXeEfFgGcrs":
-                    pos += 1
-                    if pos >= lineLen:
-                        break
-                    c = line[pos]
-                if c in "diouxXeEfFgGcrs":
-                    formatter += c
-                self.__error(lineno, formatPos, "M131", formatter)
-    
     def __checkPrintStatements(self):
         """
         Private method to check for print statements.
@@ -321,3 +311,291 @@
             else:
                 self.__error(node.lineno - 1, node.col_offset, "M702",
                              ", ".join(expectedImports))
+    
+    def __checkPep3101(self):
+        """
+        Private method to check for old style string formatting.
+        """
+        for lineno, line in enumerate(self.__source):
+            match = self.__pep3101FormatRegex.search(line)
+            if match:
+                lineLen = len(line)
+                pos = line.find('%')
+                formatPos = pos
+                formatter = '%'
+                if line[pos + 1] == "(":
+                    pos = line.find(")", pos)
+                c = line[pos]
+                while c not in "diouxXeEfFgGcrs":
+                    pos += 1
+                    if pos >= lineLen:
+                        break
+                    c = line[pos]
+                if c in "diouxXeEfFgGcrs":
+                    formatter += c
+                self.__error(lineno, formatPos, "M601", formatter)
+    
+    def __checkFormatString(self):
+        """
+        Private method to check string format strings.
+        """
+        visitor = TextVisitor()
+        visitor.visit(self.__tree)
+        for node in visitor.nodes:
+            text = node.s
+            if sys.version_info[0] > 2 and isinstance(text, bytes):
+                try:
+                    # TODO: Maybe decode using file encoding?
+                    text = text.decode('utf-8')
+                except UnicodeDecodeError:
+                    continue
+            fields, implicit, explicit = self.__getFields(text)
+            if implicit:
+                if node in visitor.calls:
+                    self.__error(node.lineno - 1, node.col_offset, "M611")
+                else:
+                    if node.is_docstring:
+                        self.__error(node.lineno - 1, node.col_offset, "M612")
+                    else:
+                        self.__error(node.lineno - 1, node.col_offset, "M613")
+            
+            if node in visitor.calls:
+                call, strArgs = visitor.calls[node]
+                
+                numbers = set()
+                names = set()
+                # Determine which fields require a keyword and which an arg
+                for name in fields:
+                    fieldMatch = self.FormatFieldRegex.match(name)
+                    try:
+                        number = int(fieldMatch.group(1))
+                    except ValueError:
+                        number = -1
+                    # negative numbers are considered keywords
+                    if number >= 0:
+                        numbers.add(number)
+                    else:
+                        names.add(fieldMatch.group(1))
+                
+                keywords = set(keyword.arg for keyword in call.keywords)
+                numArgs = len(call.args)
+                if strArgs:
+                    numArgs -= 1
+                if sys.version_info < (3, 5):
+                    hasKwArgs = bool(call.kwargs)
+                    hasStarArgs = bool(call.starargs)
+                else:
+                    hasKwArgs = any(kw.arg is None for kw in call.keywords)
+                    hasStarArgs = sum(1 for arg in call.args
+                                      if isinstance(arg, ast.Starred))
+                    
+                    if hasKwArgs:
+                        keywords.discard(None)
+                    if hasStarArgs:
+                        numArgs -= 1
+                
+                # if starargs or kwargs is not None, it can't count the
+                # parameters but at least check if the args are used
+                if hasKwArgs:
+                    if not names:
+                        # No names but kwargs
+                        self.__error(call.lineno - 1, call.col_offset, "M623")
+                if hasStarArgs:
+                    if not numbers:
+                        # No numbers but args
+                        self.__error(call.lineno - 1, call.col_offset, "M624")
+                
+                if not hasKwArgs and not hasStarArgs:
+                    # can actually verify numbers and names
+                    for number in sorted(numbers):
+                        if number >= numArgs:
+                            self.__error(call.lineno - 1, call.col_offset,
+                                         "M621", number)
+                    
+                    for name in sorted(names):
+                        if name not in keywords:
+                            self.__error(call.lineno - 1, call.col_offset,
+                                         "M622", name)
+                
+                for arg in range(numArgs):
+                    if arg not in numbers:
+                        self.__error(call.lineno - 1, call.col_offset, "M631",
+                                     arg)
+                
+                for keyword in keywords:
+                    if keyword not in names:
+                        self.__error(call.lineno - 1, call.col_offset, "M632",
+                                     keyword)
+                
+                if implicit and explicit:
+                    self.__error(call.lineno - 1, call.col_offset, "M625")
+    
+    def __getFields(self, string):
+        """
+        Private method to extract the format field information.
+        
+        @param string format string to be parsed
+        @type str
+        @return format field information as a tuple with fields, implicit
+            field definitions present and explicit field definitions present
+        @rtype tuple of set of str, bool, bool
+        """
+        fields = set()
+        cnt = itertools.count()
+        implicit = False
+        explicit = False
+        try:
+            for literal, field, spec, conv in self.Formatter.parse(string):
+                if field is not None and (conv is None or conv in 'rsa'):
+                    if not field:
+                        field = str(next(cnt))
+                        implicit = True
+                    else:
+                        explicit = True
+                    fields.add(field)
+                    fields.update(parsedSpec[1]
+                                  for parsedSpec in self.Formatter.parse(spec)
+                                  if parsedSpec[1] is not None)
+        except ValueError:
+            return set(), False, False
+        else:
+            return fields, implicit, explicit
+
+
+class TextVisitor(ast.NodeVisitor):
+    """
+    Class implementing a node visitor for bytes and str instances.
+
+    It tries to detect docstrings as string of the first expression of each
+    module, class or function.
+    """
+    # modelled after the string format flake8 extension
+    
+    def __init__(self):
+        """
+        Constructor
+        """
+        super(TextVisitor, self).__init__()
+        self.nodes = []
+        self.calls = {}
+
+    def __addNode(self, node):
+        """
+        Private method to add a node to our list of nodes.
+        
+        @param node reference to the node to add
+        @type ast.AST
+        """
+        if not hasattr(node, 'is_docstring'):
+            node.is_docstring = False
+        self.nodes.append(node)
+
+    def __isBaseString(self, node):
+        """
+        Private method to determine, if a node is a base string node.
+        
+        @param node reference to the node to check
+        @type ast.AST
+        @return flag indicating a base string
+        @rtype bool
+        """
+        typ = (ast.Str,)
+        if sys.version_info[0] > 2:
+            typ += (ast.Bytes,)
+        return isinstance(node, typ)
+
+    def visit_Str(self, node):
+        """
+        Public method to record a string node.
+        
+        @param node reference to the string node
+        @type ast.Str
+        """
+        self.__addNode(node)
+
+    def visit_Bytes(self, node):
+        """
+        Public method to record a bytes node.
+        
+        @param node reference to the bytes node
+        @type ast.Bytes
+        """
+        self.__addNode(node)
+
+    def __visitDefinition(self, node):
+        """
+        Private method handling class and function definitions.
+        
+        @param node reference to the node to handle
+        @type ast.FunctionDef or ast.ClassDef
+        """
+        # Manually traverse class or function definition
+        # * Handle decorators normally
+        # * Use special check for body content
+        # * Don't handle the rest (e.g. bases)
+        for decorator in node.decorator_list:
+            self.visit(decorator)
+        self.__visitBody(node)
+
+    def __visitBody(self, node):
+        """
+        Private method to traverse the body of the node manually.
+
+        If the first node is an expression which contains a string or bytes it
+        marks that as a docstring.
+        
+        @param node reference to the node to traverse
+        @type ast.AST
+        """
+        if (node.body and isinstance(node.body[0], ast.Expr) and
+                self.__isBaseString(node.body[0].value)):
+            node.body[0].value.is_docstring = True
+
+        for subnode in node.body:
+            self.visit(subnode)
+
+    def visit_Module(self, node):
+        """
+        Public method to handle a module.
+        
+        @param node reference to the node to handle
+        @type ast.Module
+        """
+        self.__visitBody(node)
+
+    def visit_ClassDef(self, node):
+        """
+        Public method to handle a class definition.
+        
+        @param node reference to the node to handle
+        @type ast.ClassDef
+        """
+        # Skipped nodes: ('name', 'bases', 'keywords', 'starargs', 'kwargs')
+        self.__visitDefinition(node)
+
+    def visit_FunctionDef(self, node):
+        """
+        Public method to handle a function definition.
+        
+        @param node reference to the node to handle
+        @type ast.FunctionDef
+        """
+        # Skipped nodes: ('name', 'args', 'returns')
+        self.__visitDefinition(node)
+
+    def visit_Call(self, node):
+        """
+        Public method to handle a function call.
+        
+        @param node reference to the node to handle
+        @type ast.Call
+        """
+        if (isinstance(node.func, ast.Attribute) and
+                node.func.attr == 'format'):
+            if self.__isBaseString(node.func.value):
+                self.calls[node.func.value] = (node, False)
+            elif (isinstance(node.func.value, ast.Name) and
+                    node.func.value.id == 'str' and node.args and
+                    self.__isBaseString(node.args[0])):
+                self.calls[node.args[0]] = (node, True)
+        super(TextVisitor, self).generic_visit(node)
--- a/Plugins/CheckerPlugins/CodeStyleChecker/translations.py	Wed Oct 28 20:15:46 2015 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/translations.py	Thu Oct 29 19:06:49 2015 +0100
@@ -394,9 +394,39 @@
     "M121": QCoreApplication.translate(
         "MiscellaneousChecker",
         "blind except: statement"),
-    "M131": QCoreApplication.translate(
+    "M601": QCoreApplication.translate(
         "MiscellaneousChecker",
         "found {0} formatter"),
+    "M611": QCoreApplication.translate(
+        "MiscellaneousChecker",
+        "format string does contain unindexed parameters"),
+    "M612": QCoreApplication.translate(
+        "MiscellaneousChecker",
+        "docstring does contain unindexed parameters"),
+    "M613": QCoreApplication.translate(
+        "MiscellaneousChecker",
+        "other string does contain unindexed parameters"),
+    "M621": QCoreApplication.translate(
+        "MiscellaneousChecker",
+        "format call uses too large index ({0})"),
+    "M622": QCoreApplication.translate(
+        "MiscellaneousChecker",
+        "format call uses missing keyword ({0})"),
+    "M623": QCoreApplication.translate(
+        "MiscellaneousChecker",
+        "format call uses keyword arguments but no named entries"),
+    "M624": QCoreApplication.translate(
+        "MiscellaneousChecker",
+        "format call uses variable arguments but no numbered entries"),
+    "M625": QCoreApplication.translate(
+        "MiscellaneousChecker",
+        "format call uses implicit and explicit indexes together"),
+    "M631": QCoreApplication.translate(
+        "MiscellaneousChecker",
+        "format call provides unused index ({0})"),
+    "M632": QCoreApplication.translate(
+        "MiscellaneousChecker",
+        "format call provides unused keyword ({0})"),
     "M701": QCoreApplication.translate(
         "MiscellaneousChecker",
         "expected these __future__ imports: {0}; but only got: {1}"),
@@ -587,6 +617,10 @@
     "C901": ["SyntaxError", "Invalid Syntax"],
     "M102": ["enc42"],
     "M131": ["%s"],
+    "M621": [5],
+    "M622": ["foo"],
+    "M631": [5],
+    "M632": ["foo"],
     "M701": ["print_function, unicode_literals", "print_function"],
     "M702": ["print_function, unicode_literals"],
     "M901": ["SyntaxError", "Invalid Syntax"],
--- a/eric6.e4p	Wed Oct 28 20:15:46 2015 +0100
+++ b/eric6.e4p	Thu Oct 29 19:06:49 2015 +0100
@@ -26,6 +26,54 @@
     <Source>DataViews/PyCoverageDialog.py</Source>
     <Source>DataViews/PyProfileDialog.py</Source>
     <Source>DataViews/__init__.py</Source>
+    <Source>DebugClients/Python/AsyncFile.py</Source>
+    <Source>DebugClients/Python/AsyncIO.py</Source>
+    <Source>DebugClients/Python/DCTestResult.py</Source>
+    <Source>DebugClients/Python/DebugBase.py</Source>
+    <Source>DebugClients/Python/DebugClient.py</Source>
+    <Source>DebugClients/Python/DebugClientBase.py</Source>
+    <Source>DebugClients/Python/DebugClientCapabilities.py</Source>
+    <Source>DebugClients/Python/DebugClientThreads.py</Source>
+    <Source>DebugClients/Python/DebugConfig.py</Source>
+    <Source>DebugClients/Python/DebugProtocol.py</Source>
+    <Source>DebugClients/Python/DebugThread.py</Source>
+    <Source>DebugClients/Python/FlexCompleter.py</Source>
+    <Source>DebugClients/Python/PyProfile.py</Source>
+    <Source>DebugClients/Python/__init__.py</Source>
+    <Source>DebugClients/Python/coverage/__init__.py</Source>
+    <Source>DebugClients/Python/coverage/__main__.py</Source>
+    <Source>DebugClients/Python/coverage/annotate.py</Source>
+    <Source>DebugClients/Python/coverage/backunittest.py</Source>
+    <Source>DebugClients/Python/coverage/backward.py</Source>
+    <Source>DebugClients/Python/coverage/bytecode.py</Source>
+    <Source>DebugClients/Python/coverage/cmdline.py</Source>
+    <Source>DebugClients/Python/coverage/collector.py</Source>
+    <Source>DebugClients/Python/coverage/config.py</Source>
+    <Source>DebugClients/Python/coverage/control.py</Source>
+    <Source>DebugClients/Python/coverage/data.py</Source>
+    <Source>DebugClients/Python/coverage/debug.py</Source>
+    <Source>DebugClients/Python/coverage/env.py</Source>
+    <Source>DebugClients/Python/coverage/execfile.py</Source>
+    <Source>DebugClients/Python/coverage/files.py</Source>
+    <Source>DebugClients/Python/coverage/html.py</Source>
+    <Source>DebugClients/Python/coverage/misc.py</Source>
+    <Source>DebugClients/Python/coverage/monkey.py</Source>
+    <Source>DebugClients/Python/coverage/parser.py</Source>
+    <Source>DebugClients/Python/coverage/phystokens.py</Source>
+    <Source>DebugClients/Python/coverage/pickle2json.py</Source>
+    <Source>DebugClients/Python/coverage/plugin.py</Source>
+    <Source>DebugClients/Python/coverage/plugin_support.py</Source>
+    <Source>DebugClients/Python/coverage/python.py</Source>
+    <Source>DebugClients/Python/coverage/pytracer.py</Source>
+    <Source>DebugClients/Python/coverage/report.py</Source>
+    <Source>DebugClients/Python/coverage/results.py</Source>
+    <Source>DebugClients/Python/coverage/summary.py</Source>
+    <Source>DebugClients/Python/coverage/templite.py</Source>
+    <Source>DebugClients/Python/coverage/test_helpers.py</Source>
+    <Source>DebugClients/Python/coverage/version.py</Source>
+    <Source>DebugClients/Python/coverage/xmlreport.py</Source>
+    <Source>DebugClients/Python/eric6dbgstub.py</Source>
+    <Source>DebugClients/Python/getpass.py</Source>
     <Source>DebugClients/Python3/AsyncFile.py</Source>
     <Source>DebugClients/Python3/AsyncIO.py</Source>
     <Source>DebugClients/Python3/DCTestResult.py</Source>
@@ -75,54 +123,6 @@
     <Source>DebugClients/Python3/coverage/xmlreport.py</Source>
     <Source>DebugClients/Python3/eric6dbgstub.py</Source>
     <Source>DebugClients/Python3/getpass.py</Source>
-    <Source>DebugClients/Python/AsyncFile.py</Source>
-    <Source>DebugClients/Python/AsyncIO.py</Source>
-    <Source>DebugClients/Python/DCTestResult.py</Source>
-    <Source>DebugClients/Python/DebugBase.py</Source>
-    <Source>DebugClients/Python/DebugClient.py</Source>
-    <Source>DebugClients/Python/DebugClientBase.py</Source>
-    <Source>DebugClients/Python/DebugClientCapabilities.py</Source>
-    <Source>DebugClients/Python/DebugClientThreads.py</Source>
-    <Source>DebugClients/Python/DebugConfig.py</Source>
-    <Source>DebugClients/Python/DebugProtocol.py</Source>
-    <Source>DebugClients/Python/DebugThread.py</Source>
-    <Source>DebugClients/Python/FlexCompleter.py</Source>
-    <Source>DebugClients/Python/PyProfile.py</Source>
-    <Source>DebugClients/Python/__init__.py</Source>
-    <Source>DebugClients/Python/coverage/__init__.py</Source>
-    <Source>DebugClients/Python/coverage/__main__.py</Source>
-    <Source>DebugClients/Python/coverage/annotate.py</Source>
-    <Source>DebugClients/Python/coverage/backunittest.py</Source>
-    <Source>DebugClients/Python/coverage/backward.py</Source>
-    <Source>DebugClients/Python/coverage/bytecode.py</Source>
-    <Source>DebugClients/Python/coverage/cmdline.py</Source>
-    <Source>DebugClients/Python/coverage/collector.py</Source>
-    <Source>DebugClients/Python/coverage/config.py</Source>
-    <Source>DebugClients/Python/coverage/control.py</Source>
-    <Source>DebugClients/Python/coverage/data.py</Source>
-    <Source>DebugClients/Python/coverage/debug.py</Source>
-    <Source>DebugClients/Python/coverage/env.py</Source>
-    <Source>DebugClients/Python/coverage/execfile.py</Source>
-    <Source>DebugClients/Python/coverage/files.py</Source>
-    <Source>DebugClients/Python/coverage/html.py</Source>
-    <Source>DebugClients/Python/coverage/misc.py</Source>
-    <Source>DebugClients/Python/coverage/monkey.py</Source>
-    <Source>DebugClients/Python/coverage/parser.py</Source>
-    <Source>DebugClients/Python/coverage/phystokens.py</Source>
-    <Source>DebugClients/Python/coverage/pickle2json.py</Source>
-    <Source>DebugClients/Python/coverage/plugin.py</Source>
-    <Source>DebugClients/Python/coverage/plugin_support.py</Source>
-    <Source>DebugClients/Python/coverage/python.py</Source>
-    <Source>DebugClients/Python/coverage/pytracer.py</Source>
-    <Source>DebugClients/Python/coverage/report.py</Source>
-    <Source>DebugClients/Python/coverage/results.py</Source>
-    <Source>DebugClients/Python/coverage/summary.py</Source>
-    <Source>DebugClients/Python/coverage/templite.py</Source>
-    <Source>DebugClients/Python/coverage/test_helpers.py</Source>
-    <Source>DebugClients/Python/coverage/version.py</Source>
-    <Source>DebugClients/Python/coverage/xmlreport.py</Source>
-    <Source>DebugClients/Python/eric6dbgstub.py</Source>
-    <Source>DebugClients/Python/getpass.py</Source>
     <Source>DebugClients/Ruby/AsyncFile.rb</Source>
     <Source>DebugClients/Ruby/AsyncIO.rb</Source>
     <Source>DebugClients/Ruby/Completer.rb</Source>
@@ -1664,14 +1664,14 @@
   <Interfaces/>
   <Others>
     <Other>.hgignore</Other>
+    <Other>APIs/Python/zope-2.10.7.api</Other>
+    <Other>APIs/Python/zope-2.11.2.api</Other>
+    <Other>APIs/Python/zope-3.3.1.api</Other>
     <Other>APIs/Python3/PyQt4.bas</Other>
     <Other>APIs/Python3/PyQt5.bas</Other>
     <Other>APIs/Python3/QScintilla2.bas</Other>
     <Other>APIs/Python3/eric6.api</Other>
     <Other>APIs/Python3/eric6.bas</Other>
-    <Other>APIs/Python/zope-2.10.7.api</Other>
-    <Other>APIs/Python/zope-2.11.2.api</Other>
-    <Other>APIs/Python/zope-3.3.1.api</Other>
     <Other>APIs/QSS/qss.api</Other>
     <Other>APIs/Ruby/Ruby-1.8.7.api</Other>
     <Other>APIs/Ruby/Ruby-1.8.7.bas</Other>
@@ -1682,8 +1682,8 @@
     <Other>CSSs</Other>
     <Other>CodeTemplates</Other>
     <Other>DTDs</Other>
+    <Other>DebugClients/Python/coverage/doc</Other>
     <Other>DebugClients/Python3/coverage/doc</Other>
-    <Other>DebugClients/Python/coverage/doc</Other>
     <Other>DesignerTemplates</Other>
     <Other>Dictionaries</Other>
     <Other>Documentation/Help</Other>
@@ -2148,6 +2148,18 @@
         <value>
           <dict>
             <key>
+              <string>CopyrightAuthor</string>
+            </key>
+            <value>
+              <string></string>
+            </value>
+            <key>
+              <string>CopyrightMinFileSize</string>
+            </key>
+            <value>
+              <int>0</int>
+            </value>
+            <key>
               <string>DocstringType</string>
             </key>
             <value>
@@ -2163,7 +2175,7 @@
               <string>ExcludeMessages</string>
             </key>
             <value>
-              <string>E265, N802, N803, N807, N808, N821, W293, C101</string>
+              <string>C101, E265, N802, N803, N807, N808, N821, W293, M801</string>
             </value>
             <key>
               <string>FixCodes</string>
@@ -2178,6 +2190,12 @@
               <bool>False</bool>
             </value>
             <key>
+              <string>FutureChecker</string>
+            </key>
+            <value>
+              <string></string>
+            </value>
+            <key>
               <string>HangClosing</string>
             </key>
             <value>
@@ -2219,6 +2237,12 @@
             <value>
               <bool>False</bool>
             </value>
+            <key>
+              <string>ValidEncodings</string>
+            </key>
+            <value>
+              <string>latin-1, utf-8</string>
+            </value>
           </dict>
         </value>
         <key>

eric ide

mercurial