diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3dcb717a..ea23d182 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,14 +33,7 @@ repos: hooks: - id: ruff args: ["--fix", "--show-fixes"] - -# Notebook formatting -- repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.0 - hooks: - - id: nbqa-ruff - additional_dependencies: [ruff==0.0.255] - args: ["--extend-ignore=B008,T20,I002,E402", "--fix", "--show-fixes"] + types_or: [python, pyi, jupyter] - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.6.1 diff --git a/docs/user-guide/notebooks/SVGHistogram.ipynb b/docs/user-guide/notebooks/SVGHistogram.ipynb index 99e9f994..8f46159a 100644 --- a/docs/user-guide/notebooks/SVGHistogram.ipynb +++ b/docs/user-guide/notebooks/SVGHistogram.ipynb @@ -575,9 +575,7 @@ " ),\n", " ]\n", "\n", - " return svg(*polygons, *texts, *circles, width=800, height=250)\n", - " pass\n", - " return None" + " return svg(*polygons, *texts, *circles, width=800, height=250)" ] }, { diff --git a/pyproject.toml b/pyproject.toml index 9b6de15d..a4512a9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,8 +38,7 @@ requires-python = ">=3.7" dependencies = [ "boost-histogram>=1.3.1,<1.5", "histoprint>=2.2.0", - 'numpy>=1.14.5;python_version<"3.12"', - 'numpy>=1.26.0b1;python_version>="3.12"', + 'numpy>=1.14.5', 'typing-extensions>=4;python_version<"3.11"', ] dynamic = ["version"] @@ -150,6 +149,7 @@ module = [ ] ignore_missing_imports = true + [tool.pylint] py-version = "3.7" extension-pkg-allow-list = ["boost_histogram._core"] @@ -184,9 +184,12 @@ messages_control.disable = [ "unused-argument", # Handled better by Ruff ] + [tool.ruff] -select = [ - "E", "F", "W", # flake8 +src = ["src"] + +[tool.ruff.lint] +extend-select = [ "B", # flake8-bugbear "I", # isort "ARG", # flake8-unused-arguments @@ -205,15 +208,14 @@ select = [ "UP", # pyupgrade "YTT", # flake8-2020 ] -extend-ignore = ["PLR", "E501", "PT011", "PT013", "PT004", "B017"] +ignore = ["PLR", "E501", "PT011", "PT013", "PT004", "B017"] typing-modules = ["hist._compat.typing"] -src = ["src"] unfixable = ["T20", "F841"] -exclude = [] isort.required-imports = ["from __future__ import annotations"] flake8-unused-arguments.ignore-variadic-names = true -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "tests/test_plot.py" = ["B008"] "docs/conf.py" = ["ARG001", "PTH"] "noxfile.py" = ["T20"] +"**.ipynb" = ["B008", "T20", "I002", "E402", "E703", "B018"]