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

add validate-pyproject #841

Merged
merged 3 commits into from
Jan 26, 2023
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
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,19 @@ repos:
args:
- --quiet
- --fix
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.11
hooks:
- id: validate-pyproject
# ----- Jupyter Notebooks -----
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.6.1
hooks:
- id: nbqa-black
- id: nbqa-ruff # ruff handles isort
args:
- --fix
- --force-exclude
- --fix
- --force-exclude
- repo: https://github.com/roy-ht/pre-commit-jupyter
rev: v1.2.1
hooks:
Expand Down
44 changes: 22 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ addopts = "--tb=short --color=yes -rsw --cov=weldx --cov-report=term-missing:ski
testpaths = "weldx"
# custom test markers, see https://docs.pytest.org/en/latest/example/markers.html#mark-examples
markers = "slow: marks tests as slow to run (skipped by default, enable with --runslow option)"
asdf_schema_root = "weldx/schemas/weldx.bam.de/weldx" # TODO: couldn't we just use the entry points to resolve this?
asdf_schema_root = "weldx/schemas/weldx.bam.de/weldx" # TODO: couldn"t we just use the entry points to resolve this?
#asdf_schema_tests_enabled = true
#asdf_schema_skip_tests =
# weldx.bam.de/weldx/datamodels/single_pass_weld-1.0.0.schema.yaml
Expand Down Expand Up @@ -182,35 +182,35 @@ ignore_errors = true
[tool.ruff]
target-version = "py38" # designated Python version
exclude = [
'__init__.py',
'doc/conf.py',
"__init__.py",
"doc/conf.py",
]
# TODO: should be the following list, but Ruff does not yet impl all of them.
# W503,W504
# E203
# C408
ignore = [
'C408',
#'E203',
'E402',
#'W503',
#'W504',
"C408",
#"E203",
"E402",
#"W503",
#"W504",
"D203", "D211", "D213"
]
line-length = 88
select = [
'B', # flake8-bugbear
'C', # flake8-comprehensions
#'D', # note: all relevant D's will be set by setting pydocstyle.convention=numpy!
'E', # pycodestyles
'F', # pyflakes
'W', # pycodestyle warnings
'UP', # pyupgrade
'T2', # flake8-print
'I001', # isort
'ICN', # import conventions, e.g. import numpy as np
#'B950', # not yet implemented by Ruff.
'RUF100', # ensure 'noqa' declarations are still valid.
"B", # flake8-bugbear
"C", # flake8-comprehensions
#"D", # note: all relevant D's will be set by setting pydocstyle.convention=numpy!
"E", # pycodestyles
"F", # pyflakes
"W", # pycodestyle warnings
"UP", # pyupgrade
"T2", # flake8-print
"I001", # isort
"ICN", # import conventions, e.g. import numpy as np
#"B950", # not yet implemented by Ruff.
"RUF100", # ensure 'noqa' declarations are still valid.
]

# Allow pydocstyle violations in certain areas.
Expand All @@ -228,7 +228,7 @@ pyupgrade = {keep-runtime-typing = true}
mccabe = {max-complexity = 15} # max branches inside a function.

[tool.ruff.isort]
known-first-party = ['weldx']
known-first-party = ["weldx"]

[tool.ruff.flake8-import-conventions]
extend-aliases = {xarray = 'xr'}
extend-aliases = {xarray = "xr"}