Created
August 28, 2020 17:45
-
-
Save coryodaniel/470bfcef8ea72a44b23e1119af894ec5 to your computer and use it in GitHub Desktop.
Shell script to find "no match of right hand side" in elixir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
# This uses the silver searcher (ag) | |
TMP_FILE=$(mktemp) | |
# find :ok tuples w/ no error match | |
ag "^\s{0,}\{:ok.*\s=" --ignore 'test' -G '.ex$' . > ${TMP_FILE} | |
# find :ok left side matches w/ no error handling | |
ag "^\s{0,}:ok.*=" --ignore 'test' -G '.ex$' . >> ${TMP_FILE} | |
# Scrub matches in list expressions and cases | |
cat ${TMP_FILE} | grep -ve '->' | grep -ve '<-' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment