Skip to content

Instantly share code, notes, and snippets.

@coreyja
Created September 1, 2020 02:41
Show Gist options
  • Save coreyja/d69858c4f0ef66aec09120c11c79901d to your computer and use it in GitHub Desktop.
Save coreyja/d69858c4f0ef66aec09120c11c79901d to your computer and use it in GitHub Desktop.
Upgrade Sorbet False Files if Flipping them doesn't break anything
#!/usr/bin/env bash
FILES_TO_TRY=$(rg '# typed: false' -l --glob "**/*.rb")
for FILE in $FILES_TO_TRY
do
sed -i.tmp 's/typed: false/typed: true/' "$FILE"
rm "$FILE.tmp"
srb tc || (
sed -i.tmp 's/typed: true/typed: false/' "$FILE" &&
rm "$FILE.tmp"
)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment