public override string GetCheckResult() { string comment = SvnlookFacade.GetComment(RepositoryPath, TransactionName); if (string.IsNullOrWhiteSpace(comment)) { return("Please write a comment describing the changes you're committing."); } var matches = Regex.Matches(comment, @"^(?<TicketNum>\w{3}-\d+)\s+(?<Message>.+?)$", RegexOptions.Multiline); if (matches.Count != 1) { return("Please include a Jira issue ticket number and a log message."); } foreach (Match match in matches) { Console.WriteLine(match.Value); if (string.IsNullOrWhiteSpace(match.Groups["TicketNum"].Value)) { return("Please include a Jira issue ticket number in the message"); } } return(string.Empty); }
public override string GetCheckResult() { string comment = SvnlookFacade.GetComment(RepositoryPath, TransactionName); return(string.IsNullOrWhiteSpace(comment) ? "Please write a comment describing the changes you're committing." : string.Empty); }
private static bool ShouldSkipValidation(string repositoryPath, string transactionName) { string comment = SvnlookFacade.GetComment(repositoryPath, transactionName); return(Regex.IsMatch(comment, SkipValidationPhrase, RegexOptions.IgnoreCase)); }