Skip to content

Commit fc51ba4

Browse files
authored
Merge pull request #894 from blink1073/add-flake
2 parents d7339c2 + 3f63828 commit fc51ba4

27 files changed

+57
-82
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ repos:
3434
hooks:
3535
- id: prettier
3636

37-
# - repo: https://github.com/pycqa/flake8
38-
# rev: 4.0.1
39-
# hooks:
40-
# - id: flake8
41-
# additional_dependencies:
42-
# [
43-
# "flake8-bugbear==20.1.4",
44-
# "flake8-logging-format==0.6.0",
45-
# "flake8-implicit-str-concat==0.2.0",
46-
# ]
37+
- repo: https://github.com/pycqa/flake8
38+
rev: 4.0.1
39+
hooks:
40+
- id: flake8
41+
additional_dependencies:
42+
[
43+
"flake8-bugbear==20.1.4",
44+
"flake8-logging-format==0.6.0",
45+
"flake8-implicit-str-concat==0.2.0",
46+
]
4747

4848
- repo: https://github.com/pre-commit/mirrors-eslint
4949
rev: v8.12.0

docs/conf.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,7 @@
217217

218218
# -- Options for LaTeX output ---------------------------------------------
219219

220-
latex_elements = {
221-
# The paper size ('letterpaper' or 'a4paper').
222-
#'papersize': 'letterpaper',
223-
# The font size ('10pt', '11pt' or '12pt').
224-
#'pointsize': '10pt',
225-
# Additional stuff for the LaTeX preamble.
226-
#'preamble': '',
227-
# Latex figure (float) alignment
228-
#'figure_align': 'htbp',
229-
}
220+
latex_elements = {}
230221

231222
# Grouping the document tree into LaTeX files. List of tuples
232223
# (source start file, target name, title,

examples/embedding/internal_ipkernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def mpl_kernel(gui):
1919
[
2020
"python",
2121
"--matplotlib=%s" % gui,
22-
#'--log-level=10'
22+
#'--log-level=10' # noqa
2323
]
2424
)
2525
return kernel

ipykernel/__init__.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
from ._version import (
2-
__version__,
3-
kernel_protocol_version,
4-
kernel_protocol_version_info,
5-
version_info,
6-
)
7-
from .connect import *
1+
from ._version import __version__ # noqa
2+
from ._version import kernel_protocol_version # noqa
3+
from ._version import kernel_protocol_version_info # noqa
4+
from ._version import version_info # noqa
5+
from .connect import * # noqa

ipykernel/comm/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
from .comm import *
2-
from .manager import *
1+
from .comm import * # noqa
2+
from .manager import * # noqa

ipykernel/compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def murmur2_x86(data, seed):
4343
return h
4444

4545

46-
convert_to_long_pathname = lambda filename: filename
46+
convert_to_long_pathname = lambda filename: filename # noqa
4747

4848
if sys.platform == "win32":
4949
try:
@@ -63,7 +63,7 @@ def _convert_to_long_pathname(filename):
6363

6464
# test that it works so if there are any issues we fail just once here
6565
_convert_to_long_pathname(__file__)
66-
except:
66+
except Exception:
6767
pass
6868
else:
6969
convert_to_long_pathname = _convert_to_long_pathname

ipykernel/debugger.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import re
33
import sys
4-
import threading
54

65
import zmq
76
from IPython.core.getipython import get_ipython

ipykernel/eventloops.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ def loop_qt5(kernel):
128128
"""Start a kernel with PyQt5 event loop integration."""
129129
if os.environ.get("QT_API", None) is None:
130130
try:
131-
import PyQt5
131+
import PyQt5 # noqa
132132

133133
os.environ["QT_API"] = "pyqt5"
134134
except ImportError:
135135
try:
136-
import PySide2
136+
import PySide2 # noqa
137137

138138
os.environ["QT_API"] = "pyside2"
139139
except ImportError:

ipykernel/inprocess/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .blocking import BlockingInProcessKernelClient
2-
from .channels import InProcessChannel, InProcessHBChannel
3-
from .client import InProcessKernelClient
4-
from .manager import InProcessKernelManager
1+
from .blocking import BlockingInProcessKernelClient # noqa
2+
from .channels import InProcessChannel, InProcessHBChannel # noqa
3+
from .client import InProcessKernelClient # noqa
4+
from .manager import InProcessKernelManager # noqa

ipykernel/inprocess/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ def hb_channel(self):
9999
# -------------------------------------
100100

101101
def execute(
102-
self, code, silent=False, store_history=True, user_expressions={}, allow_stdin=None
102+
self, code, silent=False, store_history=True, user_expressions=None, allow_stdin=None
103103
):
104104
if allow_stdin is None:
105105
allow_stdin = self.allow_stdin
106106
content = dict(
107107
code=code,
108108
silent=silent,
109109
store_history=store_history,
110-
user_expressions=user_expressions,
110+
user_expressions=user_expressions or {},
111111
allow_stdin=allow_stdin,
112112
)
113113
msg = self.session.msg("execute_request", content)

0 commit comments

Comments
 (0)