diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e5a66b..a2fea46 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.0 + rev: 0.27.1 hooks: - id: check-github-workflows @@ -65,11 +65,15 @@ repos: ["jsonschema>=2.6", "traitlets>=5.13", "jupyter_core>5.4"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.3 + rev: v0.1.5 hooks: - id: ruff + types_or: [python, jupyter] + exclude: "tests/.*.ipynb" args: ["--fix", "--show-fixes"] - id: ruff-format + exclude: "tests/.*.ipynb" + types_or: [python, jupyter] - repo: https://github.com/scientific-python/cookie rev: "2023.10.27" diff --git a/pyproject.toml b/pyproject.toml index 8c997fa..78ff794 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,10 @@ nowarn = "test -W default {args}" detached = true dependencies = ["pre-commit"] [tool.hatch.envs.lint.scripts] -build = "pre-commit run --all-files ruff" +build = [ + "pre-commit run --all-files ruff", + "pre-commit run --all-files ruff-format" +] [tool.hatch.envs.typing] dependencies = [ "pre-commit"] @@ -136,7 +139,6 @@ disable_error_code = ["no-untyped-def", "no-untyped-call"] warn_unreachable = true [tool.ruff] -target-version = "py38" line-length = 100 [tool.ruff.format] diff --git a/tests/test4custom.ipynb b/tests/test4custom.ipynb index 68a0da9..d5586d0 100644 --- a/tests/test4custom.ipynb +++ b/tests/test4custom.ipynb @@ -26,7 +26,7 @@ "import IPython\n", "\n", "bundle = {}\n", - "bundle['application/vnd.raw.v1+json'] = {'apples': ['🍎', '🍏'], 'bananas': 2, 'oranges': 'apples'}\n", + "bundle[\"application/vnd.raw.v1+json\"] = {\"apples\": [\"🍎\", \"🍏\"], \"bananas\": 2, \"oranges\": \"apples\"}\n", "\n", "IPython.display.display(bundle, raw=True)" ]