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

[pre-commit.ci] pre-commit suggestions #163

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -21,15 +21,15 @@ repos:
- id: detect-private-key

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
rev: v4.0.0-alpha.8
Borda marked this conversation as resolved.
Show resolved Hide resolved
hooks:
- id: prettier
files: \.(json|yml|yaml|toml)
# https://prettier.io/docs/en/options.html#print-width
args: ["--print-width=120"]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: [tomli]
Expand All @@ -45,17 +45,17 @@ repos:
- mdformat_frontmatter

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.2
rev: v0.5.2
hooks:
- id: ruff-format
- id: ruff
args: ["--fix"]

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.7.0
rev: 2.1.4
hooks:
- id: pyproject-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
rev: v0.18
hooks:
- id: validate-pyproject
108 changes: 56 additions & 52 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,59 @@ target-version = "py38"
line-length = 120
# Enable Pyflakes `E` and `F` codes by default.
lint.select = [
"E", "W", # see: https://pypi.org/project/pycodestyle
"F", # see: https://pypi.org/project/pyflakes
"I", #see: https://pypi.org/project/isort/
"D", # see: https://pypi.org/project/pydocstyle
"N", # see: https://pypi.org/project/pep8-naming
"S", # see: https://pypi.org/project/flake8-bandit
"UP", # see: https://docs.astral.sh/ruff/rules/#pyupgrade-up
"D", # see: https://pypi.org/project/pydocstyle
"E",
"F", # see: https://pypi.org/project/pyflakes
"I", #see: https://pypi.org/project/isort/
"N", # see: https://pypi.org/project/pep8-naming
"S", # see: https://pypi.org/project/flake8-bandit
"UP", # see: https://docs.astral.sh/ruff/rules/#pyupgrade-up
"W", # see: https://pypi.org/project/pycodestyle
]
lint.extend-select = [
"A", # see: https://pypi.org/project/flake8-builtins
"B", # see: https://pypi.org/project/flake8-bugbear
"C4", # see: https://pypi.org/project/flake8-comprehensions
"PT", # see: https://pypi.org/project/flake8-pytest-style
"RET", # see: https://pypi.org/project/flake8-return
"SIM", # see: https://pypi.org/project/flake8-simplify
"YTT", # see: https://pypi.org/project/flake8-2020
"ANN", # see: https://pypi.org/project/flake8-annotations
"TID", # see: https://pypi.org/project/flake8-tidy-imports/
"T10", # see: https://pypi.org/project/flake8-debugger
"Q", # see: https://pypi.org/project/flake8-quotes
"EXE", # see: https://pypi.org/project/flake8-executable
"ISC", # see: https://pypi.org/project/flake8-implicit-str-concat
"PIE", # see: https://pypi.org/project/flake8-pie
"PLE", # see: https://pypi.org/project/pylint/
"PERF", # see: https://pypi.org/project/perflint/
"PYI", # see: https://pypi.org/project/flake8-pyi/
"RUF", # see: https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"A", # see: https://pypi.org/project/flake8-builtins
"ANN", # see: https://pypi.org/project/flake8-annotations
"B", # see: https://pypi.org/project/flake8-bugbear
"C4", # see: https://pypi.org/project/flake8-comprehensions
"EXE", # see: https://pypi.org/project/flake8-executable
"ISC", # see: https://pypi.org/project/flake8-implicit-str-concat
"PERF", # see: https://pypi.org/project/perflint/
"PIE", # see: https://pypi.org/project/flake8-pie
"PLE", # see: https://pypi.org/project/pylint/
"PT", # see: https://pypi.org/project/flake8-pytest-style
"PYI", # see: https://pypi.org/project/flake8-pyi/
"Q", # see: https://pypi.org/project/flake8-quotes
"RET", # see: https://pypi.org/project/flake8-return
"RUF", # see: https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"SIM", # see: https://pypi.org/project/flake8-simplify
"T10", # see: https://pypi.org/project/flake8-debugger
"TID", # see: https://pypi.org/project/flake8-tidy-imports/
"YTT", # see: https://pypi.org/project/flake8-2020
]
lint.ignore-init-module-imports = true
lint.unfixable = ["F401"]
lint.ignore = [
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
]

[tool.ruff.lint.per-file-ignores]
"setup.py" = ["D100", "SIM115"]
"__about__.py" = ["D100"]
"__init__.py" = ["D100"]

[tool.ruff.lint.pydocstyle]
# Use Google-style docstrings.
convention = "google"

lint.per-file-ignores."__about__.py" = [
"D100",
]
lint.per-file-ignores."__init__.py" = [
"D100",
]
#[tool.ruff.pycodestyle]
#ignore-overlong-task-comments = true

[tool.ruff.lint.mccabe]
lint.per-file-ignores."setup.py" = [
"D100",
"SIM115",
]
lint.unfixable = [
"F401",
]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
lint.mccabe.max-complexity = 10
# Use Google-style docstrings.
lint.pydocstyle.convention = "google"
lint.ignore-init-module-imports = true

[tool.isort]
profile = "black"
Expand All @@ -75,18 +79,18 @@ quiet-level = 3

[tool.pytest.ini_options]
norecursedirs = [
".git",
".github",
"dist",
"build",
"docs",
".git",
".github",
"dist",
"build",
"docs",
]
addopts = [
"--strict-markers",
"--doctest-modules",
# "--doctest-plus",
"--color=yes",
"--disable-pytest-warnings",
"--strict-markers",
"--doctest-modules",
# "--doctest-plus",
"--color=yes",
"--disable-pytest-warnings",
]
# ToDo
#filterwarnings = ["error::FutureWarning"]
Expand All @@ -95,6 +99,6 @@ junit_duration_report = "call"

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"pass",
"pragma: no cover",
"pass",
]
Loading