Skip to content

Commit 35ddd78

Browse files
authored
Clarify pygrep behaviour when matching at the end of a string
It is not obvious that newline is included in the matched line and it took me quite some time to figure out.
1 parent b693fb8 commit 35ddd78

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sections/new-hooks.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,9 @@ For multiline matches, use `args: [--multiline]`.
489489

490490
To require all files to match, use `args: [--negate]`.
491491

492+
The single line matches include trailing newline, you need to include it to
493+
match something at the end of the string, for example `word\n$'.
494+
492495
__Support:__ pygrep hooks are supported on all platforms which pre-commit runs
493496
on.
494497

0 commit comments

Comments
 (0)