Extended the doc style checker again and corrected some doc style issues.

Thu, 20 Jul 2017 18:53:24 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 20 Jul 2017 18:53:24 +0200
changeset 5815
223fa32b3a32
parent 5814
50b299f6eb98
child 5822
c61cd6803da2

Extended the doc style checker again and corrected some doc style issues.

DebugClients/Python/BreakpointWatch.py file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Source/eric6.DebugClients.Python.BreakpointWatch.html file | annotate | diff | comparison | revisions
Documentation/Source/eric6.QScintilla.SpellChecker.html file | annotate | diff | comparison | revisions
Documentation/Source/eric6.Toolbox.PyQt4ImportHook.html file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py file | annotate | diff | comparison | revisions
QScintilla/SpellChecker.py file | annotate | diff | comparison | revisions
Toolbox/PyQt4ImportHook.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python/BreakpointWatch.py	Thu Jul 20 18:42:33 2017 +0200
+++ b/DebugClients/Python/BreakpointWatch.py	Thu Jul 20 18:53:24 2017 +0200
@@ -83,7 +83,7 @@
     @staticmethod
     def clear_break(filename, lineno):
         """
-        Public method reimplemented from bdb.py to clear a breakpoint.
+        Static method reimplemented from bdb.py to clear a breakpoint.
         
         @param filename file name of the bp to retrieve
         @type str
@@ -98,7 +98,7 @@
     @staticmethod
     def clear_all_breaks():
         """
-        Public method to clear all breakpoints.
+        Static method to clear all breakpoints.
         """
         Breakpoint.breaks.clear()
         Breakpoint.breakInFile.clear()
@@ -107,7 +107,7 @@
     @staticmethod
     def get_break(filename, lineno):
         """
-        Public method to get the breakpoint of a particular line.
+        Static method to get the breakpoint of a particular line.
         
         Because eric6 supports only one breakpoint per line, this
         method will return only one breakpoint.
@@ -124,7 +124,7 @@
     @staticmethod
     def effectiveBreak(filename, lineno, frame):
         """
-        Public method to determine which breakpoint for this filename:lineno
+        Static method to determine which breakpoint for this filename:lineno
         is to be acted upon.
 
         Called only if we know there is a bpt at this
@@ -248,7 +248,7 @@
     @staticmethod
     def clear_watch(cond):
         """
-        Public method to clear a watch expression.
+        Static method to clear a watch expression.
         
         @param cond expression of the watch expression to be cleared
         @type str
@@ -261,14 +261,14 @@
     @staticmethod
     def clear_all_watches():
         """
-        Public method to clear all watch expressions.
+        Static method to clear all watch expressions.
         """
         del Watch.watches[:]
 
     @staticmethod
     def get_watch(cond):
         """
-        Public method to get a watch expression.
+        Static method to get a watch expression.
         
         @param cond expression of the watch expression to be cleared
         @type str
@@ -282,7 +282,7 @@
     @staticmethod
     def effectiveWatch(frame):
         """
-        Public method to determine, if a watch expression is effective.
+        Static method to determine, if a watch expression is effective.
         
         @param frame the current execution frame
         @type frame object
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Source/eric6.DebugClients.Python.BreakpointWatch.html	Thu Jul 20 18:42:33 2017 +0200
+++ b/Documentation/Source/eric6.DebugClients.Python.BreakpointWatch.html	Thu Jul 20 18:53:24 2017 +0200
@@ -88,16 +88,16 @@
 <table>
 <tr>
 <td><a href="#Breakpoint.clear_all_breaks">clear_all_breaks</a></td>
-<td>Public method to clear all breakpoints.</td>
+<td>Static method to clear all breakpoints.</td>
 </tr><tr>
 <td><a href="#Breakpoint.clear_break">clear_break</a></td>
-<td>Public method reimplemented from bdb.py to clear a breakpoint.</td>
+<td>Static method reimplemented from bdb.py to clear a breakpoint.</td>
 </tr><tr>
 <td><a href="#Breakpoint.effectiveBreak">effectiveBreak</a></td>
-<td>Public method to determine which breakpoint for this filename:lineno is to be acted upon.</td>
+<td>Static method to determine which breakpoint for this filename:lineno is to be acted upon.</td>
 </tr><tr>
 <td><a href="#Breakpoint.get_break">get_break</a></td>
-<td>Public method to get the breakpoint of a particular line.</td>
+<td>Static method to get the breakpoint of a particular line.</td>
 </tr>
 </table>
 <a NAME="Breakpoint.__init__" ID="Breakpoint.__init__"></a>
@@ -138,12 +138,12 @@
 <h4>Breakpoint.clear_all_breaks (static)</h4>
 <b>clear_all_breaks</b>(<i></i>)
 <p>
-        Public method to clear all breakpoints.
+        Static method to clear all breakpoints.
 </p><a NAME="Breakpoint.clear_break" ID="Breakpoint.clear_break"></a>
 <h4>Breakpoint.clear_break (static)</h4>
 <b>clear_break</b>(<i>lineno</i>)
 <p>
-        Public method reimplemented from bdb.py to clear a breakpoint.
+        Static method reimplemented from bdb.py to clear a breakpoint.
 </p><dl>
 <dt><i>filename</i> (str)</dt>
 <dd>
@@ -156,7 +156,7 @@
 <h4>Breakpoint.effectiveBreak (static)</h4>
 <b>effectiveBreak</b>(<i>lineno, frame</i>)
 <p>
-        Public method to determine which breakpoint for this filename:lineno
+        Static method to determine which breakpoint for this filename:lineno
         is to be acted upon.
 </p><p>
         Called only if we know there is a bpt at this
@@ -188,7 +188,7 @@
 <h4>Breakpoint.get_break (static)</h4>
 <b>get_break</b>(<i>lineno</i>)
 <p>
-        Public method to get the breakpoint of a particular line.
+        Static method to get the breakpoint of a particular line.
 </p><p>
         Because eric6 supports only one breakpoint per line, this
         method will return only one breakpoint.
@@ -251,16 +251,16 @@
 <table>
 <tr>
 <td><a href="#Watch.clear_all_watches">clear_all_watches</a></td>
-<td>Public method to clear all watch expressions.</td>
+<td>Static method to clear all watch expressions.</td>
 </tr><tr>
 <td><a href="#Watch.clear_watch">clear_watch</a></td>
-<td>Public method to clear a watch expression.</td>
+<td>Static method to clear a watch expression.</td>
 </tr><tr>
 <td><a href="#Watch.effectiveWatch">effectiveWatch</a></td>
-<td>Public method to determine, if a watch expression is effective.</td>
+<td>Static method to determine, if a watch expression is effective.</td>
 </tr><tr>
 <td><a href="#Watch.get_watch">get_watch</a></td>
-<td>Public method to get a watch expression.</td>
+<td>Static method to get a watch expression.</td>
 </tr>
 </table>
 <a NAME="Watch.__init__" ID="Watch.__init__"></a>
@@ -301,12 +301,12 @@
 <h4>Watch.clear_all_watches (static)</h4>
 <b>clear_all_watches</b>(<i></i>)
 <p>
-        Public method to clear all watch expressions.
+        Static method to clear all watch expressions.
 </p><a NAME="Watch.clear_watch" ID="Watch.clear_watch"></a>
 <h4>Watch.clear_watch (static)</h4>
 <b>clear_watch</b>(<i></i>)
 <p>
-        Public method to clear a watch expression.
+        Static method to clear a watch expression.
 </p><dl>
 <dt><i>cond</i> (str)</dt>
 <dd>
@@ -316,7 +316,7 @@
 <h4>Watch.effectiveWatch (static)</h4>
 <b>effectiveWatch</b>(<i></i>)
 <p>
-        Public method to determine, if a watch expression is effective.
+        Static method to determine, if a watch expression is effective.
 </p><dl>
 <dt><i>frame</i> (frame object)</dt>
 <dd>
@@ -337,7 +337,7 @@
 <h4>Watch.get_watch (static)</h4>
 <b>get_watch</b>(<i></i>)
 <p>
-        Public method to get a watch expression.
+        Static method to get a watch expression.
 </p><dl>
 <dt><i>cond</i> (str)</dt>
 <dd>
--- a/Documentation/Source/eric6.QScintilla.SpellChecker.html	Thu Jul 20 18:42:33 2017 +0200
+++ b/Documentation/Source/eric6.QScintilla.SpellChecker.html	Thu Jul 20 18:53:24 2017 +0200
@@ -56,7 +56,7 @@
 <table>
 <tr>
 <td><a href="#SpellChecker._getDict">_getDict</a></td>
-<td>Protected classmethod to get a new dictionary.</td>
+<td>Protected class method to get a new dictionary.</td>
 </tr><tr>
 <td><a href="#SpellChecker.getAvailableLanguages">getAvailableLanguages</a></td>
 <td>Class method to get all available languages.</td>
@@ -167,7 +167,7 @@
 <h4>SpellChecker._getDict (class method)</h4>
 <b>_getDict</b>(<i>lang, pwl="", pel=""</i>)
 <p>
-        Protected classmethod to get a new dictionary.
+        Protected class method to get a new dictionary.
 </p><dl>
 <dt><i>lang</i></dt>
 <dd>
--- a/Documentation/Source/eric6.Toolbox.PyQt4ImportHook.html	Thu Jul 20 18:42:33 2017 +0200
+++ b/Documentation/Source/eric6.Toolbox.PyQt4ImportHook.html	Thu Jul 20 18:53:24 2017 +0200
@@ -72,7 +72,7 @@
 <table>
 <tr>
 <td><a href="#PyQt4Importer.QComboBox_currentData">QComboBox_currentData</a></td>
-<td>Public method to emulate the currentData method of Qt5.</td>
+<td>Static method to emulate the currentData method of Qt5.</td>
 </tr>
 </table>
 <a NAME="PyQt4Importer.__init__" ID="PyQt4Importer.__init__"></a>
@@ -117,17 +117,25 @@
 <h4>PyQt4Importer.QComboBox_currentData (static)</h4>
 <b>QComboBox_currentData</b>(<i>role=None</i>)
 <p>
-        Public method to emulate the currentData method of Qt5.
+        Static method to emulate the currentData method of Qt5.
 </p><dl>
-<dt><i>role</i></dt>
+<dt><i>other</i> (QComboBox)</dt>
 <dd>
-role of which data should be retrived
+reference to the combo box to get the user data of
+</dd><dt><i>role</i> (int)</dt>
+<dd>
+role of which data should be retrieved
 </dd>
 </dl><dl>
 <dt>Returns:</dt>
 <dd>
 stored data at current selection
 </dd>
+</dl><dl>
+<dt>Return Type:</dt>
+<dd>
+any
+</dd>
 </dl>
 <div align="right"><a href="#top">Up</a></div>
 <hr />
--- a/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py	Thu Jul 20 18:42:33 2017 +0200
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py	Thu Jul 20 18:53:24 2017 +0200
@@ -1384,9 +1384,24 @@
                     self.__error(docstringContext.start() + lineNumber, 0,
                                  "D232", 'special')
             elif context.special() == "staticmethod":
-                if firstWord != 'static':
+                secondWord = summary.strip().split(None, 2)[1].lower()
+                if firstWord != 'static' and secondWord != 'static':
                     self.__error(docstringContext.start() + lineNumber, 0,
                                  "D232", 'static')
+                elif secondWord == 'static':
+                    if functionName.startswith(('__', 'on_')):
+                        if firstWord != 'private':
+                            self.__error(docstringContext.start() + lineNumber,
+                                         0, "D232", 'private static')
+                    elif functionName.startswith('_') or \
+                            functionName.endswith('Event'):
+                        if firstWord != 'protected':
+                            self.__error(docstringContext.start() + lineNumber,
+                                         0, "D232", 'protected static')
+                    else:
+                        if firstWord != 'public':
+                            self.__error(docstringContext.start() + lineNumber,
+                                         0, "D232", 'public static')
             elif arguments.startswith(('cls,', 'cls)')) or \
                     context.special() == "classmethod":
                 secondWord = summary.strip().split(None, 2)[1].lower()
--- a/QScintilla/SpellChecker.py	Thu Jul 20 18:42:33 2017 +0200
+++ b/QScintilla/SpellChecker.py	Thu Jul 20 18:53:24 2017 +0200
@@ -129,7 +129,7 @@
     @classmethod
     def _getDict(cls, lang, pwl="", pel=""):
         """
-        Protected classmethod to get a new dictionary.
+        Protected class method to get a new dictionary.
         
         @param lang the language to be used as the default (string).
             The string should be in language locale format (e.g. en_US, de).
--- a/Toolbox/PyQt4ImportHook.py	Thu Jul 20 18:42:33 2017 +0200
+++ b/Toolbox/PyQt4ImportHook.py	Thu Jul 20 18:53:24 2017 +0200
@@ -12,6 +12,7 @@
 import sys
 import importlib
 
+
 class PyQt4Importer(object):
     """
     Class implementing an importer converting PyQt5 imports to PyQt4
@@ -40,10 +41,14 @@
     @staticmethod
     def QComboBox_currentData(other, role=None):
         """
-        Public method to emulate the currentData method of Qt5.
+        Static method to emulate the currentData method of Qt5.
         
-        @param role role of which data should be retrived
+        @param other reference to the combo box to get the user data of
+        @type QComboBox
+        @param role role of which data should be retrieved
+        @type int
         @return stored data at current selection
+        @rtype any
         """
         import PyQt4.Qt
         if role is None:

eric ide

mercurial