parameters: (self, message: str, project: str)
docstring: Check that the given message is valid.
  
          :param message: Commit message to validate.
          :param project: Project commit is targeting.
          :return: True if the message is valid.
docstring_summary: Check that the given message is valid.
docstring_tokens: Check that the given message is valid .
function: def validate_msg(self, message: str, project: str) -> bool:
          """
          Check that the given message is valid.
  
          :param message: Commit message to validate.
          :param project: Project commit is targeting.
          :return: True if the message is valid.
          """
          valid_matches = [valid_pattern.match(message) for valid_pattern in VALID_PATTERNS]
          if any(valid_matches):
              ticket_matches = [pattern.match(message) for pattern in VALID_PATTERNS[0:2]]
              for match in [ticket_match for ticket_match in ticket_matches if ticket_match]:
                  if not self.validate_ticket(match.group("ticket"), project):
                      print(
                          ERROR_MSG.format(
                              error_msg="Reference to a internal Jira Ticket",
                              branch=project,
                              commit_message=message,
                          ))
                      return False
              return True
          elif any(private_pattern.match(message) for private_pattern in PRIVATE_PATTERNS):
              print(
                  ERROR_MSG.format(
                      error_msg="Reference to a private project",
                      branch=project,
                      commit_message=message,
                  ))
              return False
          else:
              print(
                  ERROR_MSG.format(
                      error_msg="Commit without a ticket",
                      branch=project,
                      commit_message=message,
                  ))
              return False
function_tokens: def validate_msg ( self , message : str , project : str ) -> bool : valid_matches = [ valid_pattern . match ( message ) for valid_pattern in VALID_PATTERNS ] if any ( valid_matches ) : ticket_matches = [ pattern . match ( message ) for pattern in VALID_PATTERNS [ 0 : 2 ] ] for match in [ ticket_match for ticket_match in ticket_matches if ticket_match ] : if not self . validate_ticket ( match . group ( "ticket" ) , project ) : print ( ERROR_MSG . format ( error_msg = "Reference to a internal Jira Ticket" , branch = project , commit_message = message , ) ) return False return True elif any ( private_pattern . match ( message ) for private_pattern in PRIVATE_PATTERNS ) : print ( ERROR_MSG . format ( error_msg = "Reference to a private project" , branch = project , commit_message = message , ) ) return False else : print ( ERROR_MSG . format ( error_msg = "Commit without a ticket" , branch = project , commit_message = message , ) ) return False