Skip to content

Commit 6303029

Browse files
committed
chore: Add discouraged function check to pre-commit.
Reimplements `make check-discouraged-functions` for Python regex.
1 parent f1abfbe commit 6303029

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,11 @@ repos:
4040
entry: (->|\.)(milli)?satoshis(?!.*\/\*\ Raw:)|(?<!sizeof)\(struct\ amount_(m)?sat\)
4141
types: [ c ]
4242
exclude: common/amount|.*/test/.*
43+
44+
# Reimplementation of `make check-discouraged-functions` for pygrep.
45+
- id: check-discouraged-functions
46+
name: Check for usage of discouraged funtions
47+
language: pygrep
48+
entry: '[^a-z_/](?:fgets|fputs|gets|scanf|sprintf)\('
49+
types: [ c ]
50+
exclude: ccan|contrib

0 commit comments

Comments
 (0)