.pre-commit-config.yaml: cleanup moving Python configuration to pyproject.toml

This commit is contained in:
Aminda Suomalainen 2024-07-12 10:04:00 +03:00
parent d9cd123551
commit 95b7e82f86
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 22 additions and 24 deletions

View File

@ -36,7 +36,7 @@ repos:
- id: check-docstring-first - id: check-docstring-first
- id: check-json - id: check-json
- id: check-merge-conflict - id: check-merge-conflict
#- id: check-toml - id: check-toml
#- id: check-xml #- id: check-xml
- id: debug-statements - id: debug-statements
- id: mixed-line-ending - id: mixed-line-ending
@ -44,7 +44,6 @@ repos:
args: [--fix=no] args: [--fix=no]
- id: pretty-format-json - id: pretty-format-json
args: [--autofix, --no-ensure-ascii] args: [--autofix, --no-ensure-ascii]
#- id: requirements-txt-fixer
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config - repo: https://github.com/pre-commit-ci/pre-commit-ci-config
rev: v1.6.1 rev: v1.6.1
hooks: hooks:
@ -59,19 +58,12 @@ repos:
rev: "v1.10.1" rev: "v1.10.1"
hooks: hooks:
- id: mypy - id: mypy
args: [--ignore-missing-imports]
additional_dependencies: [types-tabulate] additional_dependencies: [types-tabulate]
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v3.16.0 rev: v3.16.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: args: [--py310-plus]
[--py310-plus]
# - repo: https://github.com/asottile/reorder-python-imports
# rev: v3.12.0
# hooks:
#- id: reorder-python-imports
#args: [--py310-plus]
- repo: https://github.com/asottile/add-trailing-comma - repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0 rev: v3.1.0
hooks: hooks:
@ -81,21 +73,17 @@ repos:
rev: 24.4.2 rev: 24.4.2
hooks: hooks:
- id: black - id: black
#Refer to pyproject.toml
#args: ["--line-length", "79", "--target-version", "py310"]
#- id: black-jupyter #- id: black-jupyter
# - repo: https://github.com/scop/pre-commit-shfmt # - repo: https://github.com/scop/pre-commit-shfmt
# rev: v3.8.0-1 # rev: v3.8.0-1
# hooks: # hooks:
# - id: shfmt # - id: shfmt
#- id: shfmt-docker
- repo: local - repo: local
hooks: hooks:
- id: pylint - id: pylint
name: pylint name: pylint
# Use as many jobs as CPU cores, disable TODO warnings entry: pylint
entry: pylint -j 0 -d W0511
language: system language: system
types_or: [python, pyi] types_or: [python, pyi]
- id: pnpm-install-dev - id: pnpm-install-dev

View File

@ -1,22 +1,32 @@
# When changing this file, read also .pre-commit-config.yaml # Black
[tool.black] [tool.black]
line-length = 79 line-length = 79
target-version = ['py310'] target-version = ['py310']
preview = true preview = true
# Mypy
[tool.mypy] [tool.mypy]
#python-executable = 'pypy3'
python_version = '3.10' python_version = '3.10'
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html # Pylint
[tool.pylint.main]
py-version = "3.10"
jobs = 0
[tool.pylint.basic]
include-naming-hint = true
[tool.pylint.format] [tool.pylint.format]
max-line-length = 79 max-line-length = 79
# Not actually used here, see .pre-commit-config.yaml for reorder-python-imports [tool.pylint."messages control"]
# that does the same thing. # Disables warnings about TODO
#[tool.isort] disable = ["W0511"]
#profile = "black"
# copy-pasted comments end. #[tool.pylint.variables]
#ignored-argument-names = "_.*|^ignored_|^unused_"
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html
[tool.isort]
profile = "black"