Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  fix NoBrokenRefDirective pattern (#1821)
  • Loading branch information
OskarStark committed Aug 28, 2024
2 parents e37133f + 2c5f359 commit 99b24f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Rule/NoBrokenRefDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function check(Lines $lines, int $number, string $filename): ViolationInt
$lines->seek($number);
$line = $lines->current();

if ($line->clean()->match('/(:ref|ref:)/') && !$line->clean()->match('/:ref:/')) {
if ($line->clean()->match('/(:ref\s|ref:)/') && !$line->clean()->match('/:ref:/')) {
return Violation::from(
'Please use correct syntax for :ref: directive',
$filename,
Expand Down
4 changes: 4 additions & 0 deletions tests/Rule/NoBrokenRefDirectiveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public static function checkProvider(): iterable
NullViolation::create(),
new RstSample('If you prefer to use'),
],
[
NullViolation::create(),
new RstSample('Then use the :method:`Symfony\\Component\\Lock\\LockInterface::refresh` method'),
],
];
}
}

0 comments on commit 99b24f8

Please sign in to comment.