Skip to content

Commit

Permalink
chore: update pre-commit hooks (#401)
Browse files Browse the repository at this point in the history
* chore: update pre-commit hooks

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.5.0...v4.6.0)
- [github.com/python-jsonschema/check-jsonschema: 0.28.1 → 0.28.4](python-jsonschema/check-jsonschema@0.28.1...0.28.4)
- [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](codespell-project/codespell@v2.2.6...v2.3.0)
- [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](pre-commit/mirrors-mypy@v1.9.0...v1.10.0)
- [github.com/astral-sh/ruff-pre-commit: v0.3.5 → v0.4.7](astral-sh/ruff-pre-commit@v0.3.5...v0.4.7)
- [github.com/scientific-python/cookie: 2024.03.10 → 2024.04.23](scientific-python/cookie@2024.03.10...2024.04.23)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* cleanup

* lint

* lint

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Steven Silvester <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and blink1073 authored Jun 10, 2024
1 parent 60b6151 commit ba2c6f5
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
pipx run doc8 --max-line-length=200
docs:
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-case-conflict
- id: check-ast
Expand All @@ -21,7 +21,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.1
rev: 0.28.4
hooks:
- id: check-github-workflows

Expand All @@ -43,10 +43,10 @@ repos:
additional_dependencies: [black==23.7.0]

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
rev: "v2.3.0"
hooks:
- id: codespell
args: ["-L", "sur,nd"]
args: ["-L", "sur,nd,assertin"]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
Expand All @@ -56,7 +56,7 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.9.0"
rev: "v1.10.0"
hooks:
- id: mypy
files: "^nbformat"
Expand All @@ -65,7 +65,7 @@ repos:
["jsonschema>=2.6", "traitlets>=5.13", "jupyter_core>5.4"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.4.7
hooks:
- id: ruff
types_or: [python, jupyter]
Expand All @@ -76,7 +76,7 @@ repos:
types_or: [python, jupyter]

- repo: https://github.com/scientific-python/cookie
rev: "2024.03.10"
rev: "2024.04.23"
hooks:
- id: sp-repo-review
additional_dependencies: ["repo-review[cli]"]
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"name": "nbformat-schema",
"version": "5.10.4",
"description": "JSON schemata for Jupyter notebook formats",
"main": "index.js",
"files": [
"nbformat/v3/nbformat.v3.schema.json",
"nbformat/v4/nbformat.v4.schema.json"
],
"repository": {
"type": "git",
"url": "git+https://github.com/jupyter/nbformat.git"
},
"keywords": [
"jupyter",
"notebook",
"json-schema"
],
"author": "Project Jupyter Contributors",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/jupyter/nbformat/issues"
},
"homepage": "https://nbformat.readthedocs.io"
"name": "nbformat-schema",
"version": "5.10.4",
"description": "JSON schemata for Jupyter notebook formats",
"main": "index.js",
"files": [
"nbformat/v3/nbformat.v3.schema.json",
"nbformat/v4/nbformat.v4.schema.json"
],
"repository": {
"type": "git",
"url": "git+https://github.com/jupyter/nbformat.git"
},
"keywords": [
"jupyter",
"notebook",
"json-schema"
],
"author": "Project Jupyter Contributors",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/jupyter/nbformat/issues"
},
"homepage": "https://nbformat.readthedocs.io"
}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ ignore = [
"RET503", # Missing explicit `return` at the end of function able...
"S101", # Use of `assert` detected"
"E731", # Do not assign a `lambda` expression"
"UP031", # Use format specifiers instead of percent format
]
unfixable = [
# Don't touch print statements
Expand Down
2 changes: 1 addition & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestsBase(unittest.TestCase):

@classmethod
def fopen(cls, f, mode="r", encoding="utf-8"):
return open(os.path.join(cls._get_files_path(), f), mode, encoding=encoding) # noqa
return open(os.path.join(cls._get_files_path(), f), mode, encoding=encoding) # noqa: SIM115

@classmethod
def _get_files_path(cls):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def sign_stdin(nb):
env = os.environ.copy()
env["JUPYTER_DATA_DIR"] = self.data_dir
p = Popen(
[sys.executable, "-m", "nbformat.sign", "--log-level=0"], # noqa
[sys.executable, "-m", "nbformat.sign", "--log-level=0"], # noqa: S603
stdin=PIPE,
stdout=PIPE,
env=env,
Expand Down
2 changes: 1 addition & 1 deletion tests/v3/formattest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


def open_utf8(fname, mode):
return open(fname, mode=mode, encoding="utf-8") # noqa
return open(fname, mode=mode, encoding="utf-8") # noqa: SIM115


class NBFormatTest:
Expand Down
2 changes: 1 addition & 1 deletion tests/v3/test_nbpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestPy(formattest.NBFormatTest, TestCase):
nb0_ref = nb0_py
ext = "py"
mod = nbpy
ignored_keys = ["collapsed", "outputs", "prompt_number", "metadata"] # noqa
ignored_keys = ["collapsed", "outputs", "prompt_number", "metadata"] # noqa: RUF012

def assertSubset(self, da, db):
"""assert that da is a subset of db, ignoring self.ignored_keys.
Expand Down
2 changes: 1 addition & 1 deletion tests/v4/formattest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


def open_utf8(fname, mode):
return open(fname, mode=mode, encoding="utf-8") # noqa
return open(fname, mode=mode, encoding="utf-8") # noqa: SIM115


class NBFormatTest:
Expand Down
2 changes: 1 addition & 1 deletion tests/v4/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_base_version_matches_latest(self):
f"nbformat.v{nbformat}.{nbformat_minor}.schema.json",
),
encoding="utf-8",
) as schema_file: # noqa
) as schema_file: # noqa: PLW2901
ver_schema = json.load(schema_file)
assert latest_schema == ver_schema

Expand Down

0 comments on commit ba2c6f5

Please sign in to comment.