From 114857f4d31697ee58e0b1417013412fd6132efa Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 21 Mar 2014 17:23:45 -0300 Subject: Add script to quickly verify some code rules. --- pkg/scripts/check_code.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 pkg/scripts/check_code.sh (limited to 'pkg/scripts/check_code.sh') diff --git a/pkg/scripts/check_code.sh b/pkg/scripts/check_code.sh new file mode 100755 index 00000000..7bbd91f6 --- /dev/null +++ b/pkg/scripts/check_code.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Escape code +esc=`echo -en "\033"` + +# Set colors +cc_green="${esc}[0;32m" +cc_red="${esc}[0;31m" +cc_normal=`echo -en "${esc}[m\017"` + + +[[ -z "$1" ]] && WHERE='src/leap/bitmask' || WHERE=$1 + +PEP8="pep8 --ignore=E202,W602 --exclude=*_rc.py,ui_*,_version.py $WHERE" +echo "${cc_green}$PEP8${cc_normal}" +$PEP8 + +echo +FLAKE8="flake8 --ignore=E202,W602 --exclude=*_rc.py,ui_*,_version.py $WHERE" +echo "${cc_green}$FLAKE8${cc_normal}" +$FLAKE8 + +echo +echo "${cc_green}Looking for 'print's, no prints in code, use logging/twisted.log.${cc_normal}" +echo `git grep -n "print " | wc -l` 'coincidences.' + +echo +echo "${cc_green}Grepping for 'pdb' code left behind.${cc_normal}" +git grep -n "pdb" + +echo +echo "${cc_green}Grepping for 'XXX|TODO|FIXME|NOTE|HACK'.${cc_normal}" +echo `git grep -E "XXX|TODO|FIXME|NOTE|HACK" | wc -l` 'coincidences.' -- cgit v1.2.3