Vigilance
A simple tool for enforcing code quality metrics on a codebase
 All Classes Namespaces Files Functions Variables Groups
QualitySuite Class Reference

Represents a full set of quality metrics that should be enforced upon a codebase. More...

+ Inheritance diagram for QualitySuite:

Public Member Functions

def __init__
 
def run
 Runs the quality suite with the provided configuration on the provided quality report. More...
 
def add_suite
 Adds a quality suite to the vigilance registry. More...
 
def available_suites
 Returns a list of all available quality suite names. More...
 
def get_suite
 Returns the QualitySuite associated with key. More...
 

Public Attributes

 suiteType
 
 reportParser
 
 constraints
 
 configurationParser
 

Static Public Attributes

dictionary Suites = {}
 

Detailed Description

Represents a full set of quality metrics that should be enforced upon a codebase.

The QualitySuite consists of a combination of the lower-level vigilance concepts:

  1. Metrics: the raw data points that comprise the quality check
  2. Quality items: the individual unit for which metrics are collected (e.g. files, modules, classes, functions, etc.)
  3. Parsers: the translators that turn raw metrics into vigilance-compatible quality items.
  4. Constraints: the requirements for the metrics collected for the various quality items in the codebase.
  5. Configuration stanzas: the configurations necessary for a user to model all of the above in a simple configuration file.

Constructor & Destructor Documentation

def __init__ (   self,
  suiteType,
  parser,
  constraints,
  configurations 
)

Member Function Documentation

def add_suite (   cls,
  key,
  parser,
  constraints,
  configurations 
)

Adds a quality suite to the vigilance registry.

This suite will be available via the vigilance command line utility.

Parameters
cls
keyThe string identifier that should be used to access the quality suite.
parserA vigilance.parser.Parser instance.
constraintsA dictionary mapping constraint labels to their corresponding class objects.
configurationsA dictionary mapping configuration keys to the corresponding class objects.
Exceptions
ValueErrorif key is already in use.
See Also
vigilance.configuration.ConfigurationStanza
vigilance.constraint.Constraint
def available_suites (   cls)

Returns a list of all available quality suite names.

def get_suite (   cls,
  key 
)

Returns the QualitySuite associated with key.

def run (   self,
  constraints,
  report 
)

Runs the quality suite with the provided configuration on the provided quality report.

Parameters
constraintsA dictionary containing the configured constraints for the suite.
reportThe string contents of the quality report.
Exceptions
vigilance.error.QualityViolationsDetected

Member Data Documentation

configurationParser
constraints
reportParser
dictionary Suites = {}
static
suiteType

The documentation for this class was generated from the following file: