Skip to content

Commit 8d01860

Browse files
authored
chore: Pre-commit hook for multi-character lstrip/rstrip (zarr-developers#3756)
1 parent b6d3ae2 commit 8d01860

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ repos:
5454
rev: v1.10.0
5555
hooks:
5656
- id: numpydoc-validation
57+
- repo: local
58+
hooks:
59+
- id: ban-lstrip-rstrip
60+
name: ban lstrip/rstrip
61+
language: pygrep
62+
# Matches .lstrip() or .rstrip() where the string argument is 2+ characters.
63+
entry: "\\.(lstrip|rstrip)\\([\"'][^\"']{2,}[\"']\\)"
64+
types: [python]
65+
files: ^(src|tests)/
5766
- repo: https://github.com/twisted/towncrier
5867
rev: 25.8.0
5968
hooks:

0 commit comments

Comments
 (0)