#########################################################################
# Default configuration file for spec_checker tool.
# This file is run using Python exec() method.
# Python expressions are valid, but anything except simple definition
# assignments is discouraged.
#########################################################################

PROJECT_ID = "SPEC_CHECKER"  # a tag to identify the project spec

# prefix for identifiers
REQUIREMENT_PREFIX = 'THE' + '-' + PROJECT_ID

#########################################################################
# these are unlikely to require modification if following standard
# conventions

# tags identifying requirement types
USER_REQ_TAG = '-USER-REQ-'
SYS_REQ_TAG = '-SYS-REQ-'
SW_REQ_TAG = '-SW-REQ-'

# regular expression to find requirements in req file
REQUIREMENT_PATTERN = '^\s*Requirement:\s*([\w-]+)\s*$'
REQUIREMENT_TRACEABILITY_START = '^\s*Traceability:\s*(' \
                                 + REQUIREMENT_PREFIX + '-.*)\s*$'
REQUIREMENT_TRACEABILITY_CONT = '^\s*(' + REQUIREMENT_PREFIX \
                                + '-[\w-]*[,;]\s*)*(' + REQUIREMENT_PREFIX \
                                + '-[\w-]*)[,;]*\s*$'

# regular expression to find design elements in des file
DESIGN_PREFIX = REQUIREMENT_PREFIX
DESIGN_PATTERN = '^[\s]*Design[\s]*:\s*([\w-])\s*$'
DES_TAG = '-DES-'

# design elements are introduced by their ids in parenthesis at end of a
# section heading line in the markdown text
# e.g.
#### some heading: brief element description (ELEMENT-ID)
DESIGN_ELEMENT_INTRODUCTION = '\#.*\((' + DESIGN_PREFIX + '.*)\)\s*$'
REQ_TO_DES_SECTION_START = '#.*Requirements -> design\s*$'
REQ_TO_DES_TABLE_START = '^--- | ---$'
REQ_TO_DES_ENTRY = '^\s*(' + REQUIREMENT_PREFIX + '.*)\s*\|\s*(' \
                   + DESIGN_PREFIX + '.*)\s*$'
DES_TO_REQ_SECTION_START = '#.*Design -> requirements\s*$'
DES_TO_REQ_TABLE_START = '^--- | ---$'
DES_TO_REQ_ENTRY = '^\s*(' + DESIGN_PREFIX + '.*)\s*\|\s*(' \
                   + REQUIREMENT_PREFIX + '.*)\s*$'
