Skip to content

Commit

Permalink
lint: pyproject & fixing (#2403)
Browse files Browse the repository at this point in the history
* lint: pyproject
* cleaning

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 3de406f)
  • Loading branch information
Borda committed Mar 18, 2024
1 parent d805e90 commit dcfc70c
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 75 deletions.
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,13 @@ repos:
args: ["--preview"]
- id: ruff
args: ["--fix"]

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.7.0
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
hooks:
- id: validate-pyproject
144 changes: 69 additions & 75 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,80 +1,8 @@
[metadata]
license_file = "LICENSE"
description-file = "README.md"

[build-system]
requires = ["setuptools", "wheel"]


[tool.check-manifest]
ignore = ["*.yml", ".github", ".github/*"]


[tool.pytest.ini_options]
norecursedirs = [".git", ".github", "dist", "build", "docs"]
addopts = [
"--strict-markers",
"--doctest-modules",
"--doctest-plus",
"--color=yes",
"--disable-pytest-warnings",
]
markers = [
"DDP: mark a test as Distributed Data Parallel",
requires = [
"setuptools",
"wheel",
]
#filterwarnings = ["error::FutureWarning"] # ToDo
xfail_strict = true
junit_duration_report = "call"
[tool.coverage.report]
exclude_lines = ["pragma: no cover", "pass"]
[tool.coverage.run]
parallel = true
concurrency = "thread"
relative_files = true


[tool.docformatter]
recursive = true
# some docstring start with r"""
wrap-summaries = 119
wrap-descriptions = 120
blank = true

[tool.codespell]
#skip = '*.py'
quiet-level = 3
# Todo: comma separated list of words; waiting for:
# https://github.com/codespell-project/codespell/issues/2839#issuecomment-1731601603
# Todo: also adding links until they ignored by its: nature
# https://github.com/codespell-project/codespell/issues/2243#issuecomment-1732019960
ignore-words-list = """
rouge, \
mape, \
wil, \
fpr, \
raison, \
archiv
"""

[tool.typos.default]
extend-ignore-identifiers-re = [
# *sigh* this just isn't worth the cost of fixing
"AttributeID.*Supress.*",
]

[tool.typos.default.extend-identifiers]
# *sigh* this just isn't worth the cost of fixing
MAPE = "MAPE"
WIL = "WIL"
Raison = "Raison"

[tool.typos.default.extend-words]
# Don't correct the surname "Teh"
fpr = "fpr"
mape = "mape"
wil = "wil"



[tool.ruff]
target-version = "py38"
Expand Down Expand Up @@ -150,6 +78,54 @@ convention = "google"
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10

[tool.codespell]
#skip = '*.py'
quiet-level = 3
# Todo: comma separated list of words; waiting for:
# https://github.com/codespell-project/codespell/issues/2839#issuecomment-1731601603
# Todo: also adding links until they ignored by its: nature
# https://github.com/codespell-project/codespell/issues/2243#issuecomment-1732019960
ignore-words-list = """
rouge, \
mape, \
wil, \
fpr, \
raison, \
archiv
"""

[tool.docformatter]
recursive = true
# some docstring start with r"""
wrap-summaries = 119
wrap-descriptions = 120
blank = true

[tool.check-manifest]
ignore = ["*.yml", ".github", ".github/*"]

[tool.pytest.ini_options]
norecursedirs = [".git", ".github", "dist", "build", "docs"]
addopts = [
"--strict-markers",
"--doctest-modules",
"--doctest-plus",
"--color=yes",
"--disable-pytest-warnings",
]
markers = [
"DDP: mark a test as Distributed Data Parallel",
]
#filterwarnings = ["error::FutureWarning"] # ToDo
xfail_strict = true
junit_duration_report = "call"

[tool.coverage.report]
exclude_lines = ["pragma: no cover", "pass"]
[tool.coverage.run]
parallel = true
concurrency = "thread"
relative_files = true

[tool.mypy]
files = ["src/torchmetrics"]
Expand Down Expand Up @@ -186,3 +162,21 @@ module = [
"torchmetrics.image.ssim",
]
ignore_errors = "True"

[tool.typos.default]
extend-ignore-identifiers-re = [
# *sigh* this just isn't worth the cost of fixing
"AttributeID.*Supress.*",
]

[tool.typos.default.extend-identifiers]
# *sigh* this just isn't worth the cost of fixing
MAPE = "MAPE"
WIL = "WIL"
Raison = "Raison"

[tool.typos.default.extend-words]
# Don't correct the surname "Teh"
fpr = "fpr"
mape = "mape"
wil = "wil"

0 comments on commit dcfc70c

Please sign in to comment.