/** * {@inheritdoc} */ protected function run(CommitInterface $commit) { $endsWithPeriod = preg_match('/^.*\\.$/u', $commit->getSummary()) === 1; if ($endsWithPeriod) { $this->addViolation($commit); } }
/** * {@inheritdoc} */ protected function run(CommitInterface $commit) { $commitLength = mb_strlen($commit->getMessage()); if ($commitLength <= self::MAX_LINE_LENGTH) { return; } $hasSummary = mb_strlen($commit->getSummary()) > 0; $hasDescription = mb_strlen($commit->getDescription()) > 0; if (!$hasSummary || !$hasDescription) { $this->addViolation($commit); } }
/** * {@inheritdoc} */ protected function run(CommitInterface $commit) { if (mb_strlen($commit->getSummary()) > 50) { $this->addViolation($commit); } }