This repository was archived by the owner on Jun 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_style_checks.sh
More file actions
32 lines (30 loc) · 1.44 KB
/
run_style_checks.sh
File metadata and controls
32 lines (30 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
##################################################################
# COMMENT IN THE FOLLOWING BLOCK TO ENABLE AUTOMATED PEP-8 FIXES #
##################################################################
# # based onhttps://gist.github.com/MichaelCurrie/802ce28c993ff2dd632c
#
# # find pep8 errors and ignore E402 module level import not at top of file due to logging
# num_errors_before=`find . -name \*.py -exec pycodestyle --ignore=E402 {} + | wc -l`;
# echo $num_errors_before;
#
# cd "$TRAVIS_BUILD_DIR";
# # try with combination of maintainer email and github token
# git config user.name "Travis AutoPEP8 Fixes";
# git checkout $TRAVIS_BRANCH;
#
# # fix pep8 erros in place if possible
# find . -name \*.py -exec autopep8 --recursive --aggressive --aggressive --in-place {} +;
# num_errors_after=`find . -name \*.py -exec pycodestyle --ignore=E402 {} + | wc -l`;
# echo $num_errors_after;
#
# if (( $num_errors_after < $num_errors_before )); then
# git commit -a -m "PEP-8 Auto-Fix";
# git config --global push.default simple; # Push only to the current branch.
# # Make sure to make the output quiet, or else the API token will
# # leak! This works because the API key can replace your password.
# git push https://$GITHUB_TOKEN@github.com/justusschock/template-repo-python.git;
# fi
cd "$TRAVIS_BUILD_DIR";
# List remaining errors, which have to be fixed manually
find . -name \*.py -exec pycodestyle --ignore=E402 {} +;