Skip to content

Commit

Permalink
Add pylint (#5)
Browse files Browse the repository at this point in the history
* Add pylint
* pylint ignores
* pytest ignores

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
  • Loading branch information
nstarman committed Jan 7, 2024
1 parent c1aeaec commit 37e1a8c
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pylint: disable=invalid-name

"""Sphinx configuration."""

import importlib.metadata
Expand Down
2 changes: 2 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pylint: disable=import-error

"""Nox sessions."""

import argparse
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies = [

[project.optional-dependencies]
test = [
"nox",
"pytest >=6",
"pytest-cov >=3",
]
Expand Down Expand Up @@ -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 = [
Expand Down Expand Up @@ -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",
]
2 changes: 2 additions & 0 deletions src/jax_quantity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pylint: disable=import-error

"""Copyright (c) 2023 Nathaniel Starkman. All rights reserved.
jax-quantity: Quantities in JAX
Expand Down
2 changes: 1 addition & 1 deletion src/jax_quantity/_core.py
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
2 changes: 2 additions & 0 deletions src/jax_quantity/_register_dispatches.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pylint: disable=import-error

from typing import Any, TypeVar

import jax
Expand Down
2 changes: 1 addition & 1 deletion src/jax_quantity/_register_primitives.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=import-error, too-many-lines

__all__: list[str] = []

Expand Down

0 comments on commit 37e1a8c

Please sign in to comment.