Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#347)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pre-commit-ci[bot] and blink1073 committed Feb 7, 2023
1 parent 7c19bcf commit 9f17128
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.19.2
rev: 0.21.0
hooks:
- id: check-github-workflows

Expand All @@ -30,12 +30,12 @@ repos:
- id: mdformat

- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.237
rev: v0.0.243
hooks:
- id: ruff
args: ["--fix"]
Expand Down
1 change: 0 additions & 1 deletion nbformat/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def convert(nb, to_version):

# If the version exist, try to convert to it one step at a time.
elif to_version in versions:

# Get the the version that this recursion will convert to as a step
# closer to the final revision. Make sure the newer of the conversion
# functions is used to perform the conversion.
Expand Down
2 changes: 1 addition & 1 deletion nbformat/json_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _validator_for_name(validator_name):
msg = f"Invalid validator '{validator_name}' value!\nValid values are: {VALIDATORS}"
raise ValueError(msg)

for (name, module, validator_cls) in _VALIDATOR_MAP:
for name, module, validator_cls in _VALIDATOR_MAP:
if module and validator_name == name:
return validator_cls
# we always return something.
Expand Down
3 changes: 0 additions & 3 deletions nbformat/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ def better_validation_error(error, version, version_minor): # noqa
key = error.schema_path[-1]
ref = None
if key.endswith("Of"):

if isinstance(error.instance, dict):
if "cell_type" in error.instance:
ref = error.instance["cell_type"] + "_cell"
Expand Down Expand Up @@ -403,7 +402,6 @@ def validate( # noqa
repair_duplicate_cell_ids: bool = _deprecated, # type: ignore
strip_invalid_metadata: bool = _deprecated, # type: ignore
) -> None:

"""Checks whether the given notebook dict-like object
conforms to the relevant notebook format schema.
Expand Down Expand Up @@ -496,7 +494,6 @@ def validate( # noqa
relax_add_props=relax_add_props,
strip_invalid_metadata=strip_invalid_metadata,
):

raise error


Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ dependencies = ["mypy>=0.990"]
test = "mypy --install-types --non-interactive {args:nbformat tests}"

[tool.hatch.envs.lint]
dependencies = ["black[jupyter]==22.12.0", "mdformat>0.7", "ruff==0.0.237"]
dependencies = ["black[jupyter]==23.1.0", "mdformat>0.7", "ruff==0.0.243"]
detached = true
[tool.hatch.envs.lint.scripts]
style = [
Expand Down Expand Up @@ -171,6 +171,8 @@ ignore = [
"E501",
# SIM105 Use `contextlib.suppress(...)`
"SIM105",
# PLR0913 Too many arguments to function call
"PLR0913",
]
unfixable = [
# Don't touch print statements
Expand Down
1 change: 0 additions & 1 deletion tests/v3/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


class TestJSON(formattest.NBFormatTest, TestCase):

nb0_ref = None
ext = "ipynb"
mod = nbjson
Expand Down
1 change: 0 additions & 1 deletion tests/v3/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def check_filename(self, path, exp_fname, exp_bname, exp_format):
self.assertEqual(fmt, exp_format)

def test_parse_filename(self):

# check format detection
self.check_filename("test.ipynb", "test.ipynb", "test", "json")
self.check_filename("test.json", "test.json", "test", "json")
Expand Down
1 change: 0 additions & 1 deletion tests/v3/test_nbpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class TestPy(formattest.NBFormatTest, TestCase):

nb0_ref = nb0_py
ext = "py"
mod = nbpy
Expand Down
1 change: 0 additions & 1 deletion tests/v4/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class TestJSON(formattest.NBFormatTest, TestCase):

nb0_ref = None
ext = "ipynb"
mod = nbjson
Expand Down

0 comments on commit 9f17128

Please sign in to comment.