Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: pyproject & fixing #2403

Merged
merged 4 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading