Fixed a few bugs in the documantation style checker.

Sat, 28 Sep 2013 14:03:37 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 28 Sep 2013 14:03:37 +0200
changeset 2944
dcca9f5c701d
parent 2940
e9348df06994
child 2945
0005e6314aea

Fixed a few bugs in the documantation style checker.

Plugins/CheckerPlugins/Pep8/Pep257Checker.py file | annotate | diff | comparison | revisions
eric5.e4p file | annotate | diff | comparison | revisions
--- a/Plugins/CheckerPlugins/Pep8/Pep257Checker.py	Fri Sep 27 19:08:31 2013 +0200
+++ b/Plugins/CheckerPlugins/Pep8/Pep257Checker.py	Sat Sep 28 14:03:37 2013 +0200
@@ -1010,7 +1010,7 @@
                 not contextLines[cti].strip().endswith(('"""', "'''")):
             cti += 1
         end = cti
-        if cti == len(contextLines):
+        if cti >= len(contextLines) - 1:
             return
         
         if contextLines[start - 1].strip():
@@ -1156,7 +1156,7 @@
                 kwargs = []
                 for line in docstringContext.source():
                     if line.strip().startswith(("@param", "@keyparam")):
-                        at, name, _ = line.strip().split(None, 2)
+                        at, name = line.strip().split(None, 2)[:2]
                         if at == "@keyparam":
                             kwargs.append(name)
                         args.append(name)
@@ -1222,7 +1222,7 @@
                 not contextLines[cti].strip().endswith(('"""', "'''")):
             cti += 1
         end = cti
-        if cti == len(contextLines):
+        if cti >= len(contextLines) - 1:
             return
         
         if isClassContext:
--- a/eric5.e4p	Fri Sep 27 19:08:31 2013 +0200
+++ b/eric5.e4p	Sat Sep 28 14:03:37 2013 +0200
@@ -1893,6 +1893,12 @@
         <value>
           <dict>
             <key>
+              <string>DocstringType</string>
+            </key>
+            <value>
+              <string>eric</string>
+            </value>
+            <key>
               <string>ExcludeFiles</string>
             </key>
             <value>

eric ide

mercurial