summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-03-26 12:20:29 -0300
committerTomás Touceda <chiiph@leap.se>2014-03-26 12:20:29 -0300
commitc51c32f4fa23980442576b3e6caa45fa6ca8099f (patch)
treecfc72f928661c7f8df081c7d61263452c0a362b3
parentc9b7206c3fc7c6e17bc4d8a733aa1f20475e86bf (diff)
parent114857f4d31697ee58e0b1417013412fd6132efa (diff)
Merge remote-tracking branch 'refs/remotes/ivan/feature/check-code-script-helper' into develop
-rwxr-xr-xpkg/scripts/check_code.sh33
1 files changed, 33 insertions, 0 deletions
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.'