Min=$1
Max=$2
Expression=$3
Count=$(grep -rP “$Expression” src | wc -l)
if [ $Count -lt $Min ] ; then echo “too few” ; exit 1 ; fi
If [ $Count -gt $Max ] ; then echo “too many” ; exit 1 ; fi
I would use SemGrep if it supported Elixir. But it does support Rust so I'll use it there.
Min=$1
Max=$2
Expression=$3
Count=$(grep -rP “$Expression” src | wc -l)
if [ $Count -lt $Min ] ; then echo “too few” ; exit 1 ; fi
If [ $Count -gt $Max ] ; then echo “too many” ; exit 1 ; fi