Skip to content

Commit

Permalink
fix lints :)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirmeier committed Feb 29, 2024
1 parent e084882 commit 4c69671
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 49 deletions.
20 changes: 0 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,6 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v2.29.1
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: ["--config=pyproject.toml"]
files: "(surjectors|examples)"

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--settings-path=pyproject.toml"]
files: "(surjectors|examples)"

- repo: https://github.com/pycqa/bandit
rev: 1.7.1
hooks:
Expand Down
27 changes: 3 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,35 +49,15 @@ dependencies = [

[tool.hatch.envs.test]
dependencies = [
"pylint>=2.15.10",
"ruff>=0.3.0",
"pytest>=7.2.0",
"pytest-cov>=4.0.0"
]

[tool.hatch.envs.test.scripts]
lint = 'pylint surjectors'
lint = 'ruff check surjectors'
test = 'pytest -v --cov=./surjectors --cov-report=xml surjectors'

[tool.black]
line-length = 80
extend-ignore = "E203"
target-version = ['py310']
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''


[tool.isort]
profile = "black"
line_length = 80
Expand All @@ -98,8 +78,7 @@ exclude = ["*_test.py", "docs/**", "examples/**"]
[tool.ruff.lint]
select = ["E4", "E7", "E9", "F"]
extend-select = [
"UP", # pyupgrade
"D", # pydocstyle
"UP", "D", "I", "PL", "S"
]

[tool.ruff.lint.pydocstyle]
Expand Down
2 changes: 1 addition & 1 deletion surjectors/_src/bijectors/masked_coupling.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from surjectors._src.distributions.transformed_distribution import Array


# pylint: disable=too-many-arguments, arguments-renamed
# ruff: noqa: PLR0913
class MaskedCoupling(Bijector, distrax.MaskedCoupling):
"""A masked coupling layer.
Expand Down
2 changes: 1 addition & 1 deletion surjectors/_src/bijectors/rq_masked_coupling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from surjectors._src.distributions.transformed_distribution import Array


# pylint: disable=too-many-arguments, arguments-renamed,too-many-ancestors
# ruff: noqa: PLR0913
class RationalQuadraticSplineMaskedCoupling(MaskedCoupling):
"""A rational quadratic spline masked coupling layer.
Expand Down
2 changes: 1 addition & 1 deletion surjectors/_src/conditioners/nn/made.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from surjectors._src.conditioners.nn.masked_linear import MaskedLinear


# pylint: disable=too-many-arguments, arguments-renamed
# ruff: noqa: PLR0913
class MADE(hk.Module):
"""Masked Autoregressive Density Estimator.
Expand Down
2 changes: 1 addition & 1 deletion surjectors/_src/conditioners/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __call__(self, inputs, *, is_training=True):
return hk.Linear(self.output_size)(h)


# pylint: disable=too-many-arguments
# ruff: noqa: PLR0913
def make_transformer(
output_size,
num_heads=4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)


# pylint: disable=too-many-arguments, arguments-renamed
# ruff: noqa: PLR0913
class RationalQuadraticSplineMaskedAutoregressiveInferenceFunnel(
MaskedAutoregressiveInferenceFunnel
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
)


# ruff: noqa: PLR0913
class RationalQuadraticSplineMaskedCouplingInferenceFunnel(
MaskedCouplingInferenceFunnel
):
Expand Down

0 comments on commit 4c69671

Please sign in to comment.