Skip to content

Commit

Permalink
Travis auto PEP8 cleanup by Persian Prince
Browse files Browse the repository at this point in the history
  • Loading branch information
persianpros committed Mar 16, 2021
1 parent d846f1a commit bd67fa6
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .travis.yml
Expand Up @@ -36,11 +36,11 @@ python:
- "2.7"

git:
depth: 1
depth: 10

before_install:
- pip install --upgrade pip tox six
- pip3 install --upgrade pip tox six
- pip install --upgrade pip tox six autopep8
- pip3 install --upgrade pip tox six autopep8
- eval "${MATRIX_EVAL}"

script:
Expand Down Expand Up @@ -80,3 +80,6 @@ script:
- python -m compileall .
- find . -type f -name "*.po" -exec msgfmt {} -o {}.mo \;
- echo done!

after_success:
- ./build.sh
74 changes: 74 additions & 0 deletions PEP8.sh
@@ -0,0 +1,74 @@
#!/bin/sh

echo ""
echo "PEP8 double aggressive safe cleanup by Persian Prince"
# Script by Persian Prince for https://github.com/OpenVisionE2
# You're not allowed to remove my copyright or reuse this script without putting this header.
echo ""
echo "Changing py files, please wait ..."
begin=$(date +"%s")

echo ""
echo "PEP8 double aggressive E401"
autopep8 . -a -a -j 0 --recursive --select=E401 --in-place
git add -u
git add *
git commit -m "PEP8 double aggressive E401 (build $TRAVIS_BUILD_NUMBER)"

echo ""
echo "PEP8 double aggressive E701, E70 and E502"
autopep8 . -a -a -j 0 --recursive --select=E701,E70,E502 --in-place
git add -u
git add *
git commit -m "PEP8 double aggressive E701, E70 and E502 (build $TRAVIS_BUILD_NUMBER)"

echo ""
echo "PEP8 double aggressive E251 and E252"
autopep8 . -a -a -j 0 --recursive --select=E251,E252 --in-place
git add -u
git add *
git commit -m "PEP8 double aggressive E251 and E252 (build $TRAVIS_BUILD_NUMBER)"

echo ""
echo "PEP8 double aggressive E20 and E211"
autopep8 . -a -a -j 0 --recursive --select=E20,E211 --in-place
git add -u
git add *
git commit -m "PEP8 double aggressive E20 and E211 (build $TRAVIS_BUILD_NUMBER)"

echo ""
echo "PEP8 double aggressive E22, E224, E241, E242 and E27"
autopep8 . -a -a -j 0 --recursive --select=E22,E224,E241,E242,E27 --in-place
git add -u
git add *
git commit -m "PEP8 double aggressive E22, E224, E241, E242 and E27 (build $TRAVIS_BUILD_NUMBER)"

echo ""
echo "PEP8 double aggressive E225 ~ E228 and E231"
autopep8 . -a -a -j 0 --recursive --select=E225,E226,E227,E228,E231 --in-place
git add -u
git add *
git commit -m "PEP8 double aggressive E225 ~ E228 and E231 (build $TRAVIS_BUILD_NUMBER)"

echo ""
echo "PEP8 double aggressive E301 ~ E306"
autopep8 . -a -a -j 0 --recursive --select=E301,E302,E303,E304,E305,E306 --in-place
git add -u
git add *
git commit -m "PEP8 double aggressive E301 ~ E306 (build $TRAVIS_BUILD_NUMBER)"

echo ""
echo "PEP8 double aggressive W291 ~ W293 and W391"
autopep8 . -a -a -j 0 --recursive --select=W291,W292,W293,W391 --in-place
git add -u
git add *
git commit -m "PEP8 double aggressive W291 ~ W293 and W391 (build $TRAVIS_BUILD_NUMBER)"

echo ""
finish=$(date +"%s")
timediff=$(($finish-$begin))
echo -e "Change time was $(($timediff / 60)) minutes and $(($timediff % 60)) seconds."
echo -e "Fast changing would be less than 1 minute."
echo ""
echo "PEP8 Done!"
echo ""
27 changes: 27 additions & 0 deletions build.sh
@@ -0,0 +1,27 @@
#!/bin/sh

# Script by Persian Prince for https://github.com/OpenVisionE2
# You're not allowed to remove my copyright or reuse this script without putting this header.

setup_git() {
git config --global user.email "bot@openvision.tech"
git config --global user.name "Open Vision python bot"
}

commit_files() {
git clean -fd
rm -rf *.pyc
rm -rf *.pyo
rm -rf *.mo
git checkout develop
./PEP8.sh
}

upload_files() {
git remote add upstream https://${GH_TOKEN}@github.com/OpenVisionE2/enigma2-openvision.git > /dev/null 2>&1
git push --quiet upstream develop || echo "failed to push with error $?"
}

setup_git
commit_files
upload_files

0 comments on commit bd67fa6

Please sign in to comment.