Пример #1
0
 /**
  * {@inheritdoc}
  */
 protected function run(CommitInterface $commit)
 {
     if (mb_strlen($commit->getDescription()) === 0) {
         return;
     }
     $pieces = preg_split("/\n\n/u", $commit->getMessage(), 2);
     if (count($pieces) !== 2 || substr($pieces[1], 0, 1) === "\n") {
         $this->addViolation($commit);
     }
 }
Пример #2
0
 /**
  * {@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);
     }
 }