Skip to content

Commit 405c5e5

Browse files
committed
Add flake8 check to Travis-CI matrix
Closes kiwix#263
1 parent 250c20c commit 405c5e5

File tree

3 files changed

+68
-20
lines changed

3 files changed

+68
-20
lines changed

.travis.yml

+5-20
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,10 @@ cache:
2727
- $HOME/.gradle/caches/
2828
- $HOME/.gradle/wrapper/
2929
- $HOME/.android/build-cache
30-
install: if [[ $TRAVIS_OS_NAME != "linux" || $DESKTOP_ONLY != 1 ]]; then travis/install_extra_deps.sh; fi
31-
script:
32-
- |
33-
if [[ $TRAVIS_OS_NAME = "linux" && $DESKTOP_ONLY == 1 ]]
34-
then
35-
if [[ $PLATFORM = "flatpak" ]]
36-
then
37-
docker build -t kiwix/build -f travis/Dockerfile_flatpak .
38-
else
39-
docker build -t kiwix/build -f travis/Dockerfile .
40-
fi
41-
docker run -e PLATFORM -e NIGHTLY_DATE -e TRAVIS_EVENT_TYPE -e DESKTOP_ONLY -e TRAVIS_TAG --device /dev/fuse --cap-add ALL --privileged kiwix/build
42-
else
43-
if [[ $TRAVIS_OS_NAME = "linux" ]]
44-
then
45-
python3.5 travis/compile_all.py
46-
else
47-
python3 travis/compile_all.py
48-
fi
49-
fi
30+
install:
31+
- if [[ $TRAVIS_OS_NAME != "linux" || $DESKTOP_ONLY != 1 ]]; then travis/install_extra_deps.sh; fi
32+
- if [[ $TEST_SUITE == "flake8_check"]]; then python3 pip install flake8; fi
33+
script: travis/travis_script.sh
5034
after_failure: travis/upload_all_log.sh
5135
deploy:
5236
- provider: script
@@ -145,6 +129,7 @@ matrix:
145129
os: osx
146130
- env: PLATFORM="iOS_i386"
147131
os: osx
132+
- env: TEST_SUITE="flake8_check"
148133

149134
notifications:
150135
irc:

setup.cfg

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[flake8]
2+
ignore =
3+
E201, # whitespace after '{'
4+
E202, # whitespace before '}'
5+
E501, # line too long
6+
E128, # continuation line under-indented for visual indent
7+
E226, # missing whitespace around arithmetic operator
8+
E126, # continuation line over-indented for hanging indent
9+
E203, # whitespace before ':'
10+
E111, # indentation is not a multiple of four
11+
E261, # at least two spaces before inline comment
12+
E124, # closing bracket does not match visual indentation
13+
E731, # do not assign a lambda expression, use a def
14+
E401, # multiple imports on one line
15+
E302, # expected 2 blank lines, found 1
16+
W503, # line break before binary operator
17+
E231, # missing whitespace after ':'
18+
E303, # too many blank lines (2)
19+
E302, # expected 2 blank lines, found 1
20+
E305, # expected 2 blank lines after class or function definition, found 1
21+
F401, # 'X' imported but unused
22+
F821, # undefined name 'X'
23+
E228, # missing whitespace around modulo operator
24+
E999, # SyntaxError: invalid syntax
25+
E225, # missing whitespace around operator
26+
F403, # 'from .base import *' used; unable to detect undefined names
27+
W391, # blank line at end of file
28+
E122, # continuation line missing indentation or outdented
29+
E251, # unexpected spaces around keyword / parameter equals
30+
E713, # test for membership should be 'not in'
31+
E722, # do not use bare except'
32+
E129, # visually indented line with same indent as next logical line
33+
E301, # expected 1 blank line, found 0
34+
E121, # continuation line under-indented for hanging indent
35+
E123, # closing bracket does not match indentation of opening bracket's line
36+
E127, # continuation line over-indented for visual indent
37+
E222, # multiple spaces after operator
38+
E265, # block comment should start with '# '
39+
F811, # redefinition of unused X
40+
E222, # multiple spaces after operator

travis/travis_script.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
if [[ $TEST_SUITE = "flake8_check" ]]
3+
then
4+
flake8 .
5+
else
6+
if [[ $TRAVIS_OS_NAME = "linux" && $DESKTOP_ONLY == 1 ]]
7+
then
8+
if [[ $PLATFORM = "flatpak" ]]
9+
then
10+
docker build -t kiwix/build -f travis/Dockerfile_flatpak .
11+
else
12+
docker build -t kiwix/build -f travis/Dockerfile .
13+
fi
14+
docker run -e PLATFORM -e NIGHTLY_DATE -e TRAVIS_EVENT_TYPE -e DESKTOP_ONLY -e TRAVIS_TAG --device /dev/fuse --cap-add ALL --privileged kiwix/build
15+
else
16+
if [[ $TRAVIS_OS_NAME = "linux" ]]
17+
then
18+
python3.5 travis/compile_all.py
19+
else
20+
python3 travis/compile_all.py
21+
fi
22+
fi
23+
fi

0 commit comments

Comments
 (0)