aboutsummaryrefslogtreecommitdiffstats
path: root/check_coding_style.sh
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-05-30 12:03:13 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-05-30 12:03:13 +1200
commit4ed5043c67848bf717e48bc509d959422c8faeb6 (patch)
tree92abe731c72d34bf6b43cbe1ecb46939953a6860 /check_coding_style.sh
parent904760c6c2927caf49b7cbe4027dd1c8dd8e9fdb (diff)
downloadmitmproxy-4ed5043c67848bf717e48bc509d959422c8faeb6.tar.gz
mitmproxy-4ed5043c67848bf717e48bc509d959422c8faeb6.tar.bz2
mitmproxy-4ed5043c67848bf717e48bc509d959422c8faeb6.zip
Add coding style check, reformat.
Diffstat (limited to 'check_coding_style.sh')
-rwxr-xr-xcheck_coding_style.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/check_coding_style.sh b/check_coding_style.sh
new file mode 100755
index 00000000..5b38e003
--- /dev/null
+++ b/check_coding_style.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+autopep8 -i -r -a -a .
+if [[ -n "$(git status -s)" ]]; then
+ echo "autopep8 yielded the following changes:"
+ git status -s
+ git --no-pager diff
+ exit 1
+fi
+
+autoflake -i -r --remove-all-unused-imports --remove-unused-variables .
+if [[ -n "$(git status -s)" ]]; then
+ echo "autoflake yielded the following changes:"
+ git status -s
+ git --no-pager diff
+ exit 1
+fi
+
+echo "Coding style seems to be ok."
+exit 0