Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Jul 15, 2023
1 parent 33585d4 commit f39da55
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ def _default_allow_remote(self):

# if blank, self.ip was configured to "*" meaning bind to all interfaces,
# see _valdate_ip
if self.ip == "": # noqa
if self.ip == "":
return True

try:
Expand Down
2 changes: 1 addition & 1 deletion jupyter_server/services/kernels/connection/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def write_stderr(self, error_message, parent_header):
err_msg["channel"] = "iopub"
self.write_message(json.dumps(err_msg, default=json_default))

def _limit_rate(self, channel, msg, msg_list): # noqa
def _limit_rate(self, channel, msg, msg_list):
"""Limit the message rate on a channel."""
if not (self.limit_rate and channel == "iopub"):
return False
Expand Down
2 changes: 1 addition & 1 deletion jupyter_server/services/kernels/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def select_subprotocol(self, subprotocols):
preferred_protocol = self.connection.kernel_ws_protocol
if preferred_protocol is None:
preferred_protocol = "v1.kernel.websocket.jupyter.org"
elif preferred_protocol == "": # noqa
elif preferred_protocol == "":
preferred_protocol = None
selected_subprotocol = preferred_protocol if preferred_protocol in subprotocols else None
# None is the default, "legacy" protocol
Expand Down
6 changes: 3 additions & 3 deletions jupyter_server/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def path2url(path):
"""Convert a local file path to a URL"""
pieces = [quote(p) for p in path.split(os.sep)]
# preserve trailing /
if pieces[-1] == "": # noqa
if pieces[-1] == "":
pieces[-1] = "/"
url = url_path_join(*pieces)
return url
Expand Down Expand Up @@ -121,7 +121,7 @@ def to_os_path(path: ApiPath, root: str = "") -> str:
root must be a filesystem path already.
"""
parts = str(path).strip("/").split("/")
parts = [p for p in parts if p != ""] # noqa # remove duplicate splits
parts = [p for p in parts if p != ""] # remove duplicate splits
path_ = os.path.join(root, *parts)
return os.path.normpath(path_)

Expand All @@ -135,7 +135,7 @@ def to_api_path(os_path: str, root: str = "") -> ApiPath:
if os_path.startswith(root):
os_path = os_path[len(root) :]
parts = os_path.strip(os.path.sep).split(os.path.sep)
parts = [p for p in parts if p != ""] # noqa # remove duplicate splits
parts = [p for p in parts if p != ""] # remove duplicate splits
path = "/".join(parts)
return ApiPath(path)

Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ detached = true
dependencies = [
"black[jupyter]==23.3.0",
"mdformat>0.7",
"ruff==0.0.270",
"ruff==0.0.276",
]
[tool.hatch.envs.lint.scripts]
style = [
Expand Down Expand Up @@ -222,6 +222,8 @@ ignore = [
"PLR0913",
# PLR0912 Too many branches
"PLR0912",
# RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
"RUF012",
]
unfixable = [
# Don't touch print statements
Expand Down

0 comments on commit f39da55

Please sign in to comment.