parameters: (requirements, file_list=None, color_text=True, allowed_collections=None, allowed_classifications=None, **kwargs)
return_statement: return logger
docstring: Tool for checking Requirement for deficiencies
docstring_summary: Tool for checking Requirement for deficiencies
docstring_tokens: Tool for checking Requirement for deficiencies
function: def check_requirements(requirements, file_list=None, color_text=True, allowed_collections=None, allowed_classifications=None, **kwargs):
      """
      Tool for checking Requirement for deficiencies
      """
  
      # Create key values for the logging messages
      log_default = kwargs.get('log_default', logging.ERROR)
      kwargs.setdefault('log_deprecated_requirement', log_default)
      kwargs.setdefault('log_deprecated_design', log_default)
      kwargs.setdefault('log_deprecated_issues', log_default)
      kwargs.setdefault('log_deprecated_detail', log_default)
      kwargs.setdefault('log_deprecated_verification', log_default)
      kwargs.setdefault('log_deprecated_validation', log_default)
      kwargs.setdefault('log_deprecated_with_details', log_default)
      kwargs.setdefault('log_missing', log_default)
      kwargs.setdefault('log_missing_requirement', log_default)
      kwargs.setdefault('log_missing_design', log_default)
      kwargs.setdefault('log_missing_issues', log_default)
      kwargs.setdefault('log_empty_requirement', log_default)
      kwargs.setdefault('log_empty_design', log_default)
      kwargs.setdefault('log_empty_issues', log_default)
      kwargs.setdefault('log_empty_verification', log_default)
      kwargs.setdefault('log_empty_validation', log_default)
      kwargs.setdefault('log_top_level_detail', log_default)
      kwargs.setdefault('log_missing_detail', log_default)
      kwargs.setdefault('log_empty_detail', log_default)
      kwargs.setdefault('log_extra_requirement', log_default)
      kwargs.setdefault('log_extra_design', log_default)
      kwargs.setdefault('log_extra_issues', log_default)
      kwargs.setdefault('log_extra_collections', log_default)
      kwargs.setdefault('log_invalid_collection', log_default)
      kwargs.setdefault('log_issue_format', log_default)
      kwargs.setdefault('log_design_files', log_default)
      kwargs.setdefault('log_validation_files', log_default)
      kwargs.setdefault('log_verification_files', log_default)
      kwargs.setdefault('log_testable', log_default)
      kwargs.setdefault('log_duplicate_requirement', log_default)
      kwargs.setdefault('log_duplicate_detail', log_default)
  
      logger = RequirementLogHelper(__name__, **kwargs)
      RequirementLogHelper.COLOR_TEXT = color_text
  
      # Setup file_list, if not provided
      if (file_list is None) and (not mooseutils.git_is_repo()):
          msg = "If the 'file_list' is not provided then the working directory must be a git repository."
          raise ValueError(msg)
      elif file_list is None:
          root = mooseutils.git_root_dir()
          ver = mooseutils.git_version()
          file_list = mooseutils.git_ls_files(root, recurse_submodules=True)
  
      # Setup allowed collections
      if allowed_collections is None:
          allowed_collections = set(moosesqa.MOOSESQA_COLLECTIONS)
  
      # Storage container for duplicate detection
      requirement_dict = collections.defaultdict(set)
  
      # Check each Requirement object for deficiencies
      for req in requirements:
          _check_requirement(req, logger, file_list, allowed_collections)
          if req.requirement is not None:
              key = [req.requirement]
              for detail in req.details:
                  if detail.detail is not None:
                      key.append(detail.detail)
              requirement_dict['\n'.join(key)].add(req)
  
      # Duplicate checking
      for txt, value in requirement_dict.items():
          if len(value) > 1:
              msg = 'Duplicate requirements found:'
              msg += '\n{}\n'.format(mooseutils.colorText(txt, 'GREY', colored=color_text))
              for r in value:
                  r.duplicate = True
                  msg += RequirementLogHelper._colorTestInfo(r, None, None, None)
  
              LogHelper.log(logger, 'log_duplicate_requirement', msg.strip('\n'))
  
      return logger
function_tokens: def check_requirements ( requirements , file_list = None , color_text = True , allowed_collections = None , allowed_classifications = None , * * kwargs ) : # Create key values for the logging messages log_default = kwargs . get ( 'log_default' , logging . ERROR ) kwargs . setdefault ( 'log_deprecated_requirement' , log_default ) kwargs . setdefault ( 'log_deprecated_design' , log_default ) kwargs . setdefault ( 'log_deprecated_issues' , log_default ) kwargs . setdefault ( 'log_deprecated_detail' , log_default ) kwargs . setdefault ( 'log_deprecated_verification' , log_default ) kwargs . setdefault ( 'log_deprecated_validation' , log_default ) kwargs . setdefault ( 'log_deprecated_with_details' , log_default ) kwargs . setdefault ( 'log_missing' , log_default ) kwargs . setdefault ( 'log_missing_requirement' , log_default ) kwargs . setdefault ( 'log_missing_design' , log_default ) kwargs . setdefault ( 'log_missing_issues' , log_default ) kwargs . setdefault ( 'log_empty_requirement' , log_default ) kwargs . setdefault ( 'log_empty_design' , log_default ) kwargs . setdefault ( 'log_empty_issues' , log_default ) kwargs . setdefault ( 'log_empty_verification' , log_default ) kwargs . setdefault ( 'log_empty_validation' , log_default ) kwargs . setdefault ( 'log_top_level_detail' , log_default ) kwargs . setdefault ( 'log_missing_detail' , log_default ) kwargs . setdefault ( 'log_empty_detail' , log_default ) kwargs . setdefault ( 'log_extra_requirement' , log_default ) kwargs . setdefault ( 'log_extra_design' , log_default ) kwargs . setdefault ( 'log_extra_issues' , log_default ) kwargs . setdefault ( 'log_extra_collections' , log_default ) kwargs . setdefault ( 'log_invalid_collection' , log_default ) kwargs . setdefault ( 'log_issue_format' , log_default ) kwargs . setdefault ( 'log_design_files' , log_default ) kwargs . setdefault ( 'log_validation_files' , log_default ) kwargs . setdefault ( 'log_verification_files' , log_default ) kwargs . setdefault ( 'log_testable' , log_default ) kwargs . setdefault ( 'log_duplicate_requirement' , log_default ) kwargs . setdefault ( 'log_duplicate_detail' , log_default ) logger = RequirementLogHelper ( __name__ , * * kwargs ) RequirementLogHelper . COLOR_TEXT = color_text # Setup file_list, if not provided if ( file_list is None ) and ( not mooseutils . git_is_repo ( ) ) : msg = "If the 'file_list' is not provided then the working directory must be a git repository." raise ValueError ( msg ) elif file_list is None : root = mooseutils . git_root_dir ( ) ver = mooseutils . git_version ( ) file_list = mooseutils . git_ls_files ( root , recurse_submodules = True ) # Setup allowed collections if allowed_collections is None : allowed_collections = set ( moosesqa . MOOSESQA_COLLECTIONS ) # Storage container for duplicate detection requirement_dict = collections . defaultdict ( set ) # Check each Requirement object for deficiencies for req in requirements : _check_requirement ( req , logger , file_list , allowed_collections ) if req . requirement is not None : key = [ req . requirement ] for detail in req . details : if detail . detail is not None : key . append ( detail . detail ) requirement_dict [ '\n' . join ( key ) ] . add ( req ) # Duplicate checking for txt , value in requirement_dict . items ( ) : if len ( value ) > 1 : msg = 'Duplicate requirements found:' msg += '\n{}\n' . format ( mooseutils . colorText ( txt , 'GREY' , colored = color_text ) ) for r in value : r . duplicate = True msg += RequirementLogHelper . _colorTestInfo ( r , None , None , None ) LogHelper . log ( logger , 'log_duplicate_requirement' , msg . strip ( '\n' ) ) return logger