diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 06cafb2..076668b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-case-conflict - id: check-ast @@ -45,11 +45,6 @@ repos: additional_dependencies: [black==23.7.0] exclude: docs/user_guide/application.md - - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.9.1 - hooks: - - id: black - - repo: https://github.com/codespell-project/codespell rev: "v2.2.6" hooks: @@ -64,13 +59,14 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.292 + rev: v0.1.3 hooks: - id: ruff args: ["--fix", "--show-fixes"] + - id: ruff-format - repo: https://github.com/scientific-python/cookie - rev: "2023.09.21" + rev: "2023.10.27" hooks: - id: sp-repo-review additional_dependencies: ["repo-review[cli]"] diff --git a/docs/conf.py b/docs/conf.py index dcde1c7..81435a3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -78,6 +78,7 @@ "logo": { "text": "Jupyter Events", }, + "navigation_with_keys": False, "icon_links": [ { # Label for this link diff --git a/jupyter_events/logger.py b/jupyter_events/logger.py index 5c0f43b..301c500 100644 --- a/jupyter_events/logger.py +++ b/jupyter_events/logger.py @@ -121,7 +121,7 @@ def _load_config( self, cfg: Config, section_names: list[str] | None = None, - traits: list[str] | None = None, + traits: list[str] | None = None, # type:ignore[override] ) -> None: """Load EventLogger traits from a Config object, patching the handlers trait in the Config object to avoid deepcopy errors. diff --git a/pyproject.toml b/pyproject.toml index 5770956..239125a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -99,17 +99,17 @@ dependencies = ["mypy~=1.6", "traitlets>=5.11.1", "jupyter_core>=5.4"] test = "mypy --install-types --non-interactive {args}" [tool.hatch.envs.lint] -dependencies = ["black[jupyter]==23.3.0", "mdformat>0.7", "ruff==0.0.287"] +dependencies = ["mdformat>0.7", "ruff==0.1.3"] detached = true [tool.hatch.envs.lint.scripts] style = [ "ruff {args:.}", - "black --check --diff {args:.}", + "ruff format {args:.}", "mdformat --check {args:docs *.md}" ] fmt = [ - "black {args:.}", "ruff --fix {args:.}", + "ruff format {args:.}", "mdformat {args:docs *.md}" ] @@ -161,16 +161,13 @@ show_error_codes = true enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] warn_unreachable = true -[tool.black] -line-length = 100 -skip-string-normalization = true -target-version = ["py37"] - [tool.ruff] -target-version = "py37" +target-version = "py38" line-length = 100 + +[tool.ruff.lint] select = [ - "A", "B", "C", "DTZ", "E", "EM", "F", "FBT", "I", "ICN", "ISC", "N", + "A", "B", "C", "DTZ", "E", "EM", "F", "FBT", "I", "ICN", "N", "PLC", "PLE", "PLR", "PLW", "Q", "RUF", "S", "SIM", "T", "TID", "UP", "W", "YTT", ] @@ -191,7 +188,7 @@ unfixable = [ "RUF100", ] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # B011 Do not call assert False since python -O removes these calls # F841 local variable 'foo' is assigned to but never used # C408 Unnecessary `dict` call