• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3set -euo pipefail
4
5# TODO: stop ignoring this. Maybe autopep8 existing stuff?
6find tools -type f -name "*.py" | xargs pep8 -r --show-source --ignore=E123,E125,E126,E127,E128,E302 || \
7    echo "pep8 run failed, please fix it" >&2
8
9NO_PROPER_SHEBANG="$(find tools examples -type f -executable -name '*.py' | xargs grep -L '#!/usr/bin/env python')"
10if [ -n "$NO_PROPER_SHEBANG" ]; then
11    echo "bad shebangs found:"
12    echo "$NO_PROPER_SHEBANG"
13    echo
14    echo "either add proper shebang or remove executable bit" >&2
15
16    exit 1
17fi
18