Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ratchets in Software Development (qntm.org)
23 points by wyrm on Nov 21, 2021 | hide | past | favorite | 2 comments


#!/bin/bash

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 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.

I would use SemGrep if it supported Elixir. But it does support Rust so I'll use it there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: