Skip to content

Instantly share code, notes, and snippets.

@atomic-penguin
Created June 21, 2012 20:35
Show Gist options
  • Save atomic-penguin/2968356 to your computer and use it in GitHub Desktop.
Save atomic-penguin/2968356 to your computer and use it in GitHub Desktop.
Foodcritic FC001 fixer script.
#!/bin/bash
if [ "$#" -eq 0 ]; then
echo "Usage: `basename $0` <cookbook directory>"
elif [ "$#" -eq 1 ]; then
find $1 -name "*[.md|.rb]" ! -name "*.git" ! -name "*.erb" | xargs perl -p -e 's!\[:([a-z0-9_]+)\]![\x27$1\x27]!gi' -i
echo "Commit message:"
echo "FC001: Use strings in preference to symbols to access node attributes"
fi
@kevinkarwaski
Copy link

Super handy! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment