Skip to content

Commit 4692b54

Browse files
[pre-commit.ci] pre-commit autoupdate (#357)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
1 parent b27672b commit 4692b54

File tree

8 files changed

+19
-15
lines changed

8 files changed

+19
-15
lines changed

.github/scripts/parse_ref.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def parse_ref(current_ref):
2525
raise Exception(f"Invalid ref `{current_ref}`!") # noqa
2626

2727
tag_name = current_ref.replace("refs/tags/", "")
28-
print(tag_name)
28+
print(tag_name) # noqa
2929

3030

3131
if __name__ == "__main__":

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
- id: trailing-whitespace
2121

2222
- repo: https://github.com/python-jsonschema/check-jsonschema
23-
rev: 0.21.0
23+
rev: 0.22.0
2424
hooks:
2525
- id: check-github-workflows
2626

@@ -30,12 +30,12 @@ repos:
3030
- id: mdformat
3131

3232
- repo: https://github.com/psf/black
33-
rev: 23.1.0
33+
rev: 23.3.0
3434
hooks:
3535
- id: black
3636

3737
- repo: https://github.com/charliermarsh/ruff-pre-commit
38-
rev: v0.0.254
38+
rev: v0.0.260
3939
hooks:
4040
- id: ruff
4141
args: ["--fix"]

nbformat/current.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
- use nbformat.vX directly to composing notebooks of a particular version
4444
""",
4545
DeprecationWarning,
46+
stacklevel=2,
4647
)
4748

4849
__all__ = [
@@ -88,7 +89,8 @@ class NBFormatError(ValueError):
8889
def _warn_format():
8990
warnings.warn(
9091
"""Non-JSON file support in nbformat is deprecated since nbformat 1.0.
91-
Use nbconvert to create files of other formats."""
92+
Use nbconvert to create files of other formats.""",
93+
stacklevel=2,
9294
)
9395

9496

nbformat/sign.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -596,21 +596,21 @@ def sign_notebook_file(self, notebook_path):
596596
def sign_notebook(self, nb, notebook_path="<stdin>"):
597597
"""Sign a notebook that's been loaded"""
598598
if self.notary.check_signature(nb):
599-
print("Notebook already signed: %s" % notebook_path)
599+
print("Notebook already signed: %s" % notebook_path) # noqa
600600
else:
601-
print("Signing notebook: %s" % notebook_path)
601+
print("Signing notebook: %s" % notebook_path) # noqa
602602
self.notary.sign(nb)
603603

604604
def generate_new_key(self):
605605
"""Generate a new notebook signature key"""
606-
print("Generating new notebook key: %s" % self.notary.secret_file)
606+
print("Generating new notebook key: %s" % self.notary.secret_file) # noqa
607607
self.notary._write_secret_file(os.urandom(1024))
608608

609609
def start(self):
610610
"""Start the trust notebook app."""
611611
if self.reset:
612612
if os.path.exists(self.notary.db_file):
613-
print("Removing trusted signature cache: %s" % self.notary.db_file)
613+
print("Removing trusted signature cache: %s" % self.notary.db_file) # noqa
614614
os.remove(self.notary.db_file)
615615
self.generate_new_key()
616616
return

nbformat/v2/nbpy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def reads(self, s, **kwargs):
4242
"""Convert a string to a notebook."""
4343
return self.to_notebook(s, **kwargs)
4444

45-
def to_notebook(self, s, **kwargs):
45+
def to_notebook(self, s, **kwargs): # noqa
4646
"""Convert a string to a notebook."""
4747
lines = s.splitlines()
4848
cells = []

nbformat/v3/nbpy.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def to_notebook(self, s, **kwargs): # noqa
113113
nb = new_notebook(worksheets=[ws])
114114
return nb
115115

116-
def new_cell(self, state, lines, **kwargs):
116+
def new_cell(self, state, lines, **kwargs): # noqa
117117
"""Create a new cell."""
118118
if state == "codecell":
119119
input_ = "\n".join(lines)
@@ -167,7 +167,7 @@ def split_lines_into_blocks(self, lines):
167167
class PyWriter(NotebookWriter):
168168
"""A Python notebook writer."""
169169

170-
def writes(self, nb, **kwargs):
170+
def writes(self, nb, **kwargs): # noqa
171171
"""Convert a notebook to a string."""
172172
lines = ["# -*- coding: utf-8 -*-"]
173173
lines.extend(

nbformat/validator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ def _get_errors(
524524
return iter(errors)
525525

526526

527-
def _strip_invalida_metadata(
527+
def _strip_invalida_metadata( # noqa
528528
nbdict: Any, version: int, version_minor: int, relax_add_props: bool
529529
) -> int:
530530
"""

pyproject.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ dependencies = ["mypy>=0.990"]
8787
test = "mypy --install-types --non-interactive {args:nbformat tests}"
8888

8989
[tool.hatch.envs.lint]
90-
dependencies = ["black[jupyter]==23.1.0", "mdformat>0.7", "ruff==0.0.254"]
90+
dependencies = ["black[jupyter]==23.3.0", "mdformat>0.7", "ruff==0.0.260"]
9191
detached = true
9292
[tool.hatch.envs.lint.scripts]
9393
style = [
@@ -192,7 +192,9 @@ unfixable = [
192192
# RUF001 contains ambiguous unicode character '–' (did you mean '-'?)
193193
# S101 Use of `assert` detected
194194
# PLR2004 Magic value used in comparison
195-
"tests/*" = ["B011", "F841", "C408", "E402", "T201", "B007", "N802", "RUF001", "RUF002", "S101", "PLR2004"]
195+
# PLC1901 `cell.source == ""` can be simplified
196+
"tests/*" = ["B011", "F841", "C408", "E402", "T201", "B007", "N802", "RUF001", "RUF002", "S101", "PLR2004",
197+
"PLC1901"]
196198
# F401 `nbxml.to_notebook` imported but unused
197199
"nbformat/*__init__.py" = ["F401"]
198200

0 commit comments

Comments
 (0)