Package epydoc :: Module checker :: Class DocChecker
[hide private]
[frames] | no frames]

Class DocChecker
source code

Documentation completeness checker. DocChecker can be used to check that specified classes of objects are documented. To check the documentation for a group of objects, you should create a DocChecker from a DocIndex that documents those objects; and then use the check method to run specified checks on the objects' documentation.

What checks are run, and what objects they are run on, are specified by the constants defined by DocChecker. These constants are divided into three groups. The check method is used to perform a check on the documentation. Its parameter is formed by or-ing together at least one value from each specifier group:
>>> checker.check(DocChecker.MODULE | DocChecker.DESCR)
To specify multiple values from a single group, simply or their values together:
>>> checker.check(DocChecker.MODULE | DocChecker.CLASS |
...               DocChecker.FUNC | DocChecker.DESCR_LAZY)


Instance Methods [hide private]
  __init__(self, docindex)
Create a new DocChecker that can be used to run checks on the documentation of the objects documented by docindex
boolean check(self, *check_sets)
Run the specified checks on the documentation of the objects contained by this DocChecker's DocIndex.
  _check(self, checks)
  _name(self, doc)
None _check_basic(self, doc)
Check the description, author, version, and see-also fields of doc.
None _check_module(self, doc)
Run checks on the module whose APIDoc is doc.
None _check_class(self, doc)
Run checks on the class whose APIDoc is doc.
  _check_property(self, doc)
None _check_var(self, doc)
Run checks on the variable whose documentation is var and whose name is name.
None _check_func(self, doc)
Run checks on the function whose APIDoc is doc.
  warning(self, msg, doc)

Class Variables [hide private]
PROPERTY  
ALL  
    Types
MODULE Type specifier that indicates that the documentation of modules should be checked.
CLASS Type specifier that indicates that the documentation of classes should be checked.
FUNC Type specifier that indicates that the documentation of functions should be checked.
VAR Type specifier that indicates that the documentation of module variables should be checked.
PARAM Type specifier that indicates that the documentation of function and method parameters should be checked.
RETURN Type specifier that indicates that the documentation of return values should be checked.
ALL_T Type specifier that indicates that the documentation of all objects should be checked.
CVAR Type specifier that indicates that the documentation of class variables should be checked.
IVAR Type specifier that indicates that the documentation of instance variables should be checked.
    Checks
TYPE Check specifier that indicates that every variable and parameter should have a @type field.
AUTHOR Check specifier that indicates that every object should have an author field.
VERSION Check specifier that indicates that every object should have a version field.
DESCR Check specifier that indicates that every object should have a description.
ALL_C Check specifier that indicates that all checks should be run.
    Publicity
PRIVATE Specifier that indicates that private objects should be checked.

Method Details [hide private]

__init__(self, docindex)
(Constructor)

source code 
Create a new DocChecker that can be used to run checks on the documentation of the objects documented by docindex
Parameters:
  • docindex (Docindex) - A documentation map containing the documentation for the objects to be checked.

check(self, *check_sets)

source code 
Run the specified checks on the documentation of the objects contained by this DocChecker's DocIndex. Any errors found are printed to standard out.
Parameters:
  • checks (int) - The checks that should be run on the documentation. This value is constructed by or-ing together the specifiers that indicate which objects should be checked, and which checks should be run. See the module description for more information. If no checks are specified, then a default set of checks will be run.
Returns: boolean
True if no problems were found.

_check(self, checks)

source code 

_name(self, doc)

source code 

_check_basic(self, doc)

source code 
Check the description, author, version, and see-also fields of doc. This is used as a helper function by _check_module, _check_class, and _check_func.
Parameters:
  • doc (ObjDoc) - The documentation that should be checked.
Returns: None

_check_module(self, doc)

source code 
Run checks on the module whose APIDoc is doc.
Parameters:
  • doc (APIDoc) - The APIDoc of the module to check.
Returns: None

_check_class(self, doc)

source code 
Run checks on the class whose APIDoc is doc.
Parameters:
  • doc (APIDoc) - The APIDoc of the class to check.
Returns: None

_check_property(self, doc)

source code 

_check_var(self, doc)

source code 
Run checks on the variable whose documentation is var and whose name is name.
Parameters:
  • doc (Doc) - The documentation for the variable to check.
  • check_type - Whether or not the variable's type should be checked. This is used to allow varargs and keyword parameters to have no type specified.
Returns: None

_check_func(self, doc)

source code 
Run checks on the function whose APIDoc is doc.
Parameters:
  • doc (APIDoc) - The APIDoc of the function to check.
Returns: None

warning(self, msg, doc)

source code 

Class Variable Details [hide private]

MODULE

Type specifier that indicates that the documentation of modules should be checked.
Type:
int
Value:
1                                                                     
      

CLASS

Type specifier that indicates that the documentation of classes should be checked.
Type:
int
Value:
2                                                                     
      

FUNC

Type specifier that indicates that the documentation of functions should be checked.
Type:
int
Value:
4                                                                     
      

VAR

Type specifier that indicates that the documentation of module variables should be checked.
Type:
int
Value:
8                                                                     
      

PARAM

Type specifier that indicates that the documentation of function and method parameters should be checked.
Type:
int
Value:
64                                                                    
      

RETURN

Type specifier that indicates that the documentation of return values should be checked.
Type:
int
Value:
128                                                                   
      

PROPERTY

Value:
256                                                                   
      

ALL_T

Type specifier that indicates that the documentation of all objects should be checked.
Type:
int
Value:
511                                                                   
      

TYPE

Check specifier that indicates that every variable and parameter should have a @type field.
Type:
int
Value:
256                                                                   
      

AUTHOR

Check specifier that indicates that every object should have an author field.
Type:
int
Value:
1024                                                                  
      

VERSION

Check specifier that indicates that every object should have a version field.
Type:
int
Value:
2048                                                                  
      

DESCR

Check specifier that indicates that every object should have a description.
Type:
int
Value:
4096                                                                  
      

ALL_C

Check specifier that indicates that all checks should be run.
Type:
int
Value:
7936                                                                  
      

PRIVATE

Specifier that indicates that private objects should be checked.
Type:
int
Value:
16384                                                                 
      

ALL

Value:
24831                                                                 
      

CVAR

Type specifier that indicates that the documentation of class variables should be checked.
Type:
int

IVAR

Type specifier that indicates that the documentation of instance variables should be checked.
Type:
int