Skip to content

Commit

Permalink
Enable flake8 by default (#8112)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 committed Feb 17, 2019
1 parent b1437ea commit 24f613c
Show file tree
Hide file tree
Showing 26 changed files with 540 additions and 414 deletions.
53 changes: 17 additions & 36 deletions .flake8
@@ -1,39 +1,20 @@
[flake8]
ignore = E111,E114,E501,E261,E266,E121,E402,E241
# TODO(sbc): Switch from the whitelist of a blacklist such as:
# exclude = ./third_party/,emmaken.py,./tools/scons/,./tools/ports/,./tests/
filename =
*/emar.py
*/emcc.py
*/emscons.py
*/emscripten.py
*/embuilder.py
*/tools/shared.py
*/tools/response_file.py
*/tools/python_selector.py
*/tools/wasm-sourcemap.py
*/tools/clean_webconsole.py
*/tools/emconfiguren.py
*/tools/emdebug_cd_merger.py
*/tools/line_endings.py
*/tools/nativize_llvm.py
*/tools/exec_llvm.py
*/tools/emmakenxx.py
*/tools/exec_llvm.py
*/tools/find_bigvars.py
*/tools/merge_pair.py
*/tools/system_libs.py
*/tools/add_license.py
*/tools/file_packager.py
*/tools/emmaken.py
*/tools/ctor_evaller.py
*/tools/duplicate_function_eliminator.py
*/tests/runner.py
*/tests/test_browser.py
*/tests/test_other.py
*/tests/test_core.py
*/tests/parallel_runner.py
*/tests/test_sanity.py
*/tests/test_benchmark.py
*/tests/test_interactive.py
*/tests/test_sockets.py
exclude =
./site/source/conf.py,
./third_party/,
./tools/scons/,
./tools/debug
./tools/ports/,
./tools/emdump.py,
./tools/emterpretify.py,
./tools/js_optimizer.py,
./tools/webidl_binder.py,
./tools/create_dom_pk_codes.py,
./tools/gen_struct_info.py,
./tools/asm_module.py,
./tools/colored_logger.py,
./tools/ffdb.py,
./tools/filelock.py, # third party code
./tests/,
8 changes: 5 additions & 3 deletions emcmake.py
Expand Up @@ -4,16 +4,18 @@
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.

import os, subprocess, sys
import subprocess
import sys
from tools import shared


#
# Main run() function
#
def run():
configure_path = shared.path_from_root('emconfigure')
return subprocess.call([shared.PYTHON, configure_path] + sys.argv[1:])

exit(subprocess.call([shared.PYTHON, configure_path] + sys.argv[1:]))

if __name__ == '__main__':
run()
sys.exit(run())
9 changes: 6 additions & 3 deletions emconfigure.py
Expand Up @@ -22,10 +22,11 @@
'''

from __future__ import print_function
import os, sys
import sys
from tools import shared
from subprocess import CalledProcessError


#
# Main run() function
#
Expand All @@ -42,15 +43,17 @@ def run():
''', file=sys.stderr)
elif 'cmake' in sys.argv[1]:
node_js = shared.NODE_JS
if type(node_js) is list: node_js = node_js[0]
if type(node_js) is list:
node_js = node_js[0]
node_js = shared.Building.which(node_js)
node_js = node_js.replace('"', '\"')
sys.argv = sys.argv[:2] + ['-DCMAKE_CROSSCOMPILING_EMULATOR="' + node_js +'"'] + sys.argv[2:]
sys.argv = sys.argv[:2] + ['-DCMAKE_CROSSCOMPILING_EMULATOR="' + node_js + '"'] + sys.argv[2:]

try:
shared.Building.configure(sys.argv[1:])
except CalledProcessError as e:
sys.exit(e.returncode)


if __name__ == '__main__':
run()
7 changes: 4 additions & 3 deletions emlink.py
Expand Up @@ -4,17 +4,17 @@
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.

'''
Fast static linker for emscripten outputs. Specifically this links asm.js modules.
"""Fast static linker for emscripten outputs. Specifically this links asm.js modules.
See https://github.com/emscripten-core/emscripten/wiki/Linking
'''
"""

from __future__ import print_function
import sys
from tools import shared
from tools.asm_module import AsmModule


def run():
try:
me, main, side, out = sys.argv[:4]
Expand All @@ -34,5 +34,6 @@ def run():
side.relocate_into(main)
main.write(out)


if __name__ == '__main__':
run()
9 changes: 5 additions & 4 deletions emmake.py
Expand Up @@ -4,8 +4,7 @@
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.

'''
This is a helper script. It runs make for you, setting
"""This is a helper script. It runs make for you, setting
the environment variables to use emcc and so forth. Usage:
emmake make [FLAGS]
Expand All @@ -20,13 +19,14 @@
emconfigure runs compilation into native code, so
that configure tests pass. emmake uses Emscripten to
generate JavaScript.
'''
"""

from __future__ import print_function
import os, sys
import sys
from tools import shared
from subprocess import CalledProcessError


#
# Main run() function
#
Expand All @@ -47,5 +47,6 @@ def run():
except CalledProcessError as e:
sys.exit(e.returncode)


if __name__ == '__main__':
run()

0 comments on commit 24f613c

Please sign in to comment.