eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py

changeset 7628
f904d0eef264
parent 7610
df7025fe26a3
child 7637
c878e8255972
diff -r 7f643d41464e -r f904d0eef264 eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py	Wed Jun 17 17:12:21 2020 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py	Wed Jun 17 20:18:54 2020 +0200
@@ -163,8 +163,6 @@
         @keyparam docType type of the documentation strings
             (string, one of 'eric' or 'pep257')
         """
-        assert docType in ("eric", "pep257")
-        
         self.__select = tuple(select)
         self.__ignore = ('',) if select else tuple(ignore)
         self.__expected = expected[:]
@@ -853,7 +851,8 @@
         
         lines = docstringContext.source()
         if len(lines) > 1:
-            nonEmptyLines = [l for l in lines if l.strip().strip('\'"')]
+            nonEmptyLines = [line for line in lines
+                             if line.strip().strip('\'"')]
             if len(nonEmptyLines) == 1:
                 modLen = len(context.indent() + '"""' +
                              nonEmptyLines[0].strip() + '"""')
@@ -879,11 +878,11 @@
         if len(lines) == 1:
             return
         
-        nonEmptyLines = [l.rstrip() for l in lines[1:] if l.strip()]
+        nonEmptyLines = [line.rstrip() for line in lines[1:] if line.strip()]
         if not nonEmptyLines:
             return
         
-        indent = min(len(l) - len(l.strip()) for l in nonEmptyLines)
+        indent = min(len(line) - len(line.strip()) for line in nonEmptyLines)
         if context.contextType() == "module":
             expectedIndent = 0
         else:

eric ide

mercurial