Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit suggestions (#267)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit suggestions

updates:
- [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](codespell-project/codespell@v2.2.6...v2.3.0)
- [github.com/pre-commit/mirrors-prettier: v3.1.0 → v4.0.0-alpha.8](pre-commit/mirrors-prettier@v3.1.0...v4.0.0-alpha.8)
- [github.com/astral-sh/ruff-pre-commit: v0.4.3 → v0.4.7](astral-sh/ruff-pre-commit@v0.4.3...v0.4.7)
- [github.com/tox-dev/pyproject-fmt: 1.8.0 → 2.1.3](tox-dev/pyproject-fmt@1.8.0...2.1.3)
- [github.com/abravalheri/validate-pyproject: v0.16 → v0.18](abravalheri/validate-pyproject@v0.16...v0.18)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] and Borda committed Jun 3, 2024
1 parent 84e0d43 commit ab1190b
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 96 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: detect-private-key

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: [tomli]
Expand Down Expand Up @@ -54,7 +54,7 @@ repos:
args: ["--print-width=120"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
rev: v0.4.7
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -67,11 +67,11 @@ repos:
- id: sphinx-lint

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.8.0
rev: 2.1.3
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
rev: v0.18
hooks:
- id: validate-pyproject
192 changes: 100 additions & 92 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,85 +5,91 @@ requires = [
]

[tool.ruff]
line-length = 120
target-version = "py38"

[tool.ruff.format]
preview = true

[tool.ruff.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
"RUF100", # see: https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
]
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
"RUF", # Ruff-specific rules
"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/
line-length = 120
format.preview = true
lint.select = [
"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
"RUF100", # see: https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"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
]
ignore = [
"E731",
]
ignore-init-module-imports = true

[tool.ruff.lint.per-file-ignores]
"docs/source/conf.py" = ["D100", "D103", "A001", "ANN001", "ANN201"]
"setup.py" = ["ANN202", "D100", "SIM115"]
"__about__.py" = ["D100"]
"__init__.py" = ["D100"]
"src/**" = [
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN401", # Dynamically typed expressions (typing.Any)
"B905", # `zip()` without an explicit `strict=` parameter
"D100", # Missing docstring in public module
"D107", # Missing docstring in `__init__`
]
"tests/**" = [
"ANN001", # Missing type annotation for function argument
"ANN101", # Missing type annotation for `self` in method
"ANN201", # Missing return type annotation for public function
"ANN202", # Missing return type annotation for private function
"ANN204", # Missing return type annotation for special method
"ANN401", # Dynamically typed expressions (typing.Any)
"B905", # `zip()` without an explicit `strict=` parameter
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"S101", # Use of `assert` detected
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
"B028", # No explicit `stacklevel` keyword argument found
lint.extend-select = [
"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
"PIE", # see: https://pypi.org/project/flake8-pie
"PLE", # see: https://pypi.org/project/pylint/
"PT", # see: https://pypi.org/project/flake8-pytest-style
"Q", # see: https://pypi.org/project/flake8-quotes
"RET", # see: https://pypi.org/project/flake8-return
"RUF", # Ruff-specific rules
"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
]

[tool.ruff.lint.pydocstyle]
lint.ignore = [
"E731",
]
lint.per-file-ignores."__about__.py" = [
"D100",
]
lint.per-file-ignores."__init__.py" = [
"D100",
]
lint.per-file-ignores."docs/source/conf.py" = [
"A001",
"ANN001",
"ANN201",
"D100",
"D103",
]
lint.per-file-ignores."setup.py" = [
"ANN202",
"D100",
"SIM115",
]
lint.per-file-ignores."src/**" = [
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN401", # Dynamically typed expressions (typing.Any)
"B905", # `zip()` without an explicit `strict=` parameter
"D100", # Missing docstring in public module
"D107", # Missing docstring in `__init__`
]
lint.per-file-ignores."tests/**" = [
"ANN001", # Missing type annotation for function argument
"ANN101", # Missing type annotation for `self` in method
"ANN201", # Missing return type annotation for public function
"ANN202", # Missing return type annotation for private function
"ANN204", # Missing return type annotation for special method
"ANN401", # Dynamically typed expressions (typing.Any)
"B028", # No explicit `stacklevel` keyword argument found
"B905", # `zip()` without an explicit `strict=` parameter
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"S101", # Use of `assert` detected
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
]
lint.mccabe.max-complexity = 10
# Use Google-style docstrings.
convention = "google"

[tool.ruff.lint.mccabe]
max-complexity = 10
lint.pydocstyle.convention = "google"
lint.ignore-init-module-imports = true

[tool.codespell]
#skip = '*.py'
Expand All @@ -103,36 +109,38 @@ blank = true

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

[tool.pytest.ini_options]
norecursedirs = [
".git",
".github",
"dist",
"build",
"docs",
".git",
".github",
"dist",
"build",
"docs",
]
addopts = [
"--strict-markers",
"--doctest-modules",
"--durations=25",
"--color=yes",
"--disable-pytest-warnings",
"--strict-markers",
"--doctest-modules",
"--durations=25",
"--color=yes",
"--disable-pytest-warnings",
]
markers = [
"online: run tests that require internet connection",
"online: run tests that require internet connection",
]
filterwarnings = ["error::FutureWarning"] # todo: "error::DeprecationWarning"
filterwarnings = [
"error::FutureWarning",
] # todo: "error::DeprecationWarning"
xfail_strict = true

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"pass",
"pragma: no cover",
"pass",
]
[tool.coverage.run]
parallel = true
Expand All @@ -141,7 +149,7 @@ relative_files = true

[tool.mypy]
files = [
"src/lightning_utilities",
"src/lightning_utilities",
]
disallow_untyped_defs = true
ignore_missing_imports = true

0 comments on commit ab1190b

Please sign in to comment.