Created
January 31, 2018 12:24
-
-
Save apritzel/5277123a6038c461170bb01b3258a0a2 to your computer and use it in GitHub Desktop.
very simple Xen coding style checker (to catch Linux copy&paste artefacts)
This file contains hidden or 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
#!/bin/sh | |
grep -n '^ *'$'\t' "$1" && echo "^^^ tabs" | |
grep -n 'if(' "$1" && echo "^^^ no space after if" | |
grep -n 'if ([^ ]' "$1" && echo "^^^ no space after if (" | |
grep -n 'while(' "$1" && echo "^^^ no space after while" | |
grep -n 'while ([^ ]' "$1" && echo "^^^ no space after while (" | |
grep -n 'for(' "$1" && echo "^^^ no space after for" | |
grep -n 'for ([^ ]' "$1" && echo "^^^ no space after for (" | |
grep -n '[ ]*[^ ].*{$' "$1" && echo "^^^ opening bracket at the end of line" | |
grep -n '} *else' "$1" && echo "^^^ else on the same line as closing bracket" | |
grep -n 'else *{' "$1" && echo "^^^ else on the same line as opening bracket" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment