TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
Ratchets in Software Development
23 points
by
wyrm
over 3 years ago
2 comments
aozgaa
over 3 years ago
#!/bin/bash<p>Min=$1<p>Max=$2<p>Expression=$3<p>Count=$(grep -rP “$Expression” src | wc -l)<p>if [ $Count -lt $Min ] ; then echo “too few” ; exit 1 ; fi<p>If [ $Count -gt $Max ] ; then echo “too many” ; exit 1 ; fi
pdimitar
over 3 years ago
I wonder if OP uses comby.dev. I'm looking forward to integrating it in pre-commit hooks and CI to make sure certain code isn't allowed.<p>I would use SemGrep if it supported Elixir. But it does support Rust so I'll use it there.