Commits

mbrochh committed 3dbeb86

Removed a rather confusing method by a simpler call to .__doc__
It turned out that at this point we can safely check for .__doc__ wihtout producing exceptions or false positives.

  • Participants
  • Parent commits b9e52dc

Comments (0)

Files changed (1)

File sphinx/ext/coverage.py

 
                             full_attr_name = '%s.%s' % (full_name, attr_name)
                             if full_attr_name not in objects:
-                                if not self._is_func_undocumented(
-                                    obj, attr_name):
+                                if len(obj.__doc__) > 0:
                                     continue
                                 attrs.append(attr_name)
 
 
             self.py_undoc[mod_name] = {'funcs': funcs, 'classes': classes}
 
-    def _is_func_undocumented(self, obj, attr_name):
-        """Last check looking at the source code. Is function really not documented?"""
-        obj_source = inspect.getsource(obj) or ''
-        obj_source = obj_source.replace(' ', '').replace('\n', '')
-        if not "def%s" % attr_name in obj_source:
-            # Funktion is not defined in this class. No documentation needed.
-            return False
-        m = re.search('def%s\([^\)]*\):"""' %attr_name, obj_source)
-        if not m:
-            return True
-        else:
-            return False
-
     def write_py_coverage(self):
         output_file = path.join(self.outdir, 'python.txt')
         op = open(output_file, 'w')