Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        private static bool ShouldSkipValidation(string repositoryPath, string transactionName)
        {
            string comment = SvnlookFacade.GetComment(repositoryPath, transactionName);

            return(Regex.IsMatch(comment, SkipValidationPhrase, RegexOptions.IgnoreCase));
        }