##// END OF EJS Templates
pyflakes to avoid missing imports
Matthias Bussonnier -
r26208:778dac10
parent child
Show More
@@ -0,0 +1,5
1 [flake8]
2 ignore = W293,E301,E271,E265,W291,E722,E302,C901,E225,E128,E122,E226,E231
3 max-line-length = 160
4 exclude = tests/*
5 max-complexity = 10
@@ -23,8 +23,11 jobs:
23 - name: Install dependencies
23 - name: Install dependencies
24 run: |
24 run: |
25 python -m pip install --upgrade pip
25 python -m pip install --upgrade pip
26 pip install mypy
26 pip install mypy pyflakes flake8
27 - name: Lint with mypy
27 - name: Lint with mypy
28 run: |
28 run: |
29 mypy IPython/terminal/ptutils.py
29 mypy IPython/terminal/ptutils.py
30 mypy IPython/core/c*.py
30 mypy IPython/core/c*.py
31 - name: Lint with pyflakes
32 run: |
33 flake8 IPython/core/magics/script.py
@@ -18,7 +18,6 from IPython.core.magic import (
18 Magics, magics_class, line_magic, cell_magic
18 Magics, magics_class, line_magic, cell_magic
19 )
19 )
20 from IPython.lib.backgroundjobs import BackgroundJobManager
20 from IPython.lib.backgroundjobs import BackgroundJobManager
21 from IPython.utils import py3compat
22 from IPython.utils.process import arg_split
21 from IPython.utils.process import arg_split
23 from traitlets import List, Dict, default
22 from traitlets import List, Dict, default
24
23
@@ -139,7 +138,7 class ScriptMagics(Magics):
139 def named_script_magic(line, cell):
138 def named_script_magic(line, cell):
140 # if line, add it as cl-flags
139 # if line, add it as cl-flags
141 if line:
140 if line:
142 line = "%s %s" % (script, line)
141 line = "%s %s" % (script, line)
143 else:
142 else:
144 line = script
143 line = script
145 return self.shebang(line, cell)
144 return self.shebang(line, cell)
@@ -262,8 +261,7 class ScriptMagics(Magics):
262 except OSError:
261 except OSError:
263 pass
262 pass
264 except Exception as e:
263 except Exception as e:
265 print("Error while terminating subprocess (pid=%i): %s" \
264 print("Error while terminating subprocess (pid=%i): %s" % (p.pid, e))
266 % (p.pid, e))
267 return
265 return
268 if args.raise_error and p.returncode!=0:
266 if args.raise_error and p.returncode!=0:
269 raise CalledProcessError(p.returncode, cell)
267 raise CalledProcessError(p.returncode, cell)
@@ -7,6 +7,7 include MANIFEST.in
7 include pytest.ini
7 include pytest.ini
8 include mypy.ini
8 include mypy.ini
9 include .mailmap
9 include .mailmap
10 include .flake8
10
11
11 recursive-exclude tools *
12 recursive-exclude tools *
12 exclude tools
13 exclude tools
General Comments 0
You need to be logged in to leave comments. Login now