diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd6eddb..5b8451b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,8 @@ ci: autofix_commit_msg: "style: pre-commit fixes" autoupdate_schedule: "monthly" +default_install_hook_types: [pre-commit, pre-push, commit-msg] + repos: - repo: https://github.com/adamchainz/blacken-docs rev: "1.16.0" @@ -85,3 +87,14 @@ repos: - id: check-dependabot - id: check-github-workflows - id: check-readthedocs + + - repo: local + hooks: + - id: pylint + name: pylint + entry: pylint + language: python + types: [python] + stages: [pre-push, manual] + additional_dependencies: + - "pylint==3.0.3" diff --git a/docs/conf.py b/docs/conf.py index 6d92518..c08d5a9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,3 +1,5 @@ +# pylint: disable=invalid-name + """Sphinx configuration.""" import importlib.metadata diff --git a/noxfile.py b/noxfile.py index d7fff84..d3c9bd2 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,3 +1,5 @@ +# pylint: disable=import-error + """Nox sessions.""" import argparse diff --git a/pyproject.toml b/pyproject.toml index c121f5a..f4369bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ dependencies = [ [project.optional-dependencies] test = [ + "nox", "pytest >=6", "pytest-cov >=3", ] @@ -79,6 +80,7 @@ addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] xfail_strict = true filterwarnings = [ "error", + "ignore:ast\\.Str is deprecated and will be removed in Python 3\\.14:DeprecationWarning", ] log_cli_level = "INFO" testpaths = [ @@ -167,5 +169,6 @@ messages_control.disable = [ "missing-function-docstring", # TODO: resolve "missing-module-docstring", "redefined-builtin", # handled by ruff + "unused-argument", # handled by ruff "wrong-import-position", ] diff --git a/src/jax_quantity/__init__.py b/src/jax_quantity/__init__.py index 5a6b1a4..5fb7fc4 100644 --- a/src/jax_quantity/__init__.py +++ b/src/jax_quantity/__init__.py @@ -1,3 +1,5 @@ +# pylint: disable=import-error + """Copyright (c) 2023 Nathaniel Starkman. All rights reserved. jax-quantity: Quantities in JAX diff --git a/src/jax_quantity/_core.py b/src/jax_quantity/_core.py index 9ee3441..50cb463 100644 --- a/src/jax_quantity/_core.py +++ b/src/jax_quantity/_core.py @@ -1,4 +1,4 @@ -# pylint: disable=no-member, unsubscriptable-object +# pylint: disable=import-error, no-member, unsubscriptable-object # b/c it doesn't understand dataclass fields __all__ = ["Quantity", "can_convert"] diff --git a/src/jax_quantity/_register_dispatches.py b/src/jax_quantity/_register_dispatches.py index 1bbb168..7337bb3 100644 --- a/src/jax_quantity/_register_dispatches.py +++ b/src/jax_quantity/_register_dispatches.py @@ -1,3 +1,5 @@ +# pylint: disable=import-error + from typing import Any, TypeVar import jax diff --git a/src/jax_quantity/_register_primitives.py b/src/jax_quantity/_register_primitives.py index 5417bcf..42c5671 100644 --- a/src/jax_quantity/_register_primitives.py +++ b/src/jax_quantity/_register_primitives.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=import-error, too-many-lines __all__: list[str] = []