devtools: Add discouraged function check to pre-commit.

Reimplements `make check-discouraged-functions` for Python regex.
This commit is contained in:
Se7enZ
2024-12-01 13:52:59 +01:00
committed by Sangbida
parent a04fdb74d9
commit 6e50148bcd

View File

@@ -28,3 +28,11 @@ repos:
entry: (->|\.)(milli)?satoshis(?!.*\/\*\ Raw:)|(?<!sizeof)\(struct\ amount_(m)?sat\)
types: [ c ]
exclude: common/amount|.*/test/.*
# Reimplementation of `make check-discouraged-functions` for pygrep.
- id: check-discouraged-functions
name: Check for usage of discouraged funtions
language: pygrep
entry: '[^a-z_/](?:fgets|fputs|gets|scanf|sprintf)\('
types: [ c ]
exclude: ccan|contrib