Unverified Commit f4aef234 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Update code checks

parent 7ad07ed2
Loading
Loading
Loading
Loading
+27 −35
Original line number Diff line number Diff line
default_stages: [commit]
minimum_pre_commit_version: 3.2.0
default_install_hook_types: [pre-commit, pre-push, commit-msg]
default_language_version: {python: "3.10"}
default_stages: [pre-commit]
repos:

- repo: meta
@@ -7,7 +10,7 @@ repos:
  - id: check-useless-excludes

- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v4.6.0
  rev: v6.0.0
  hooks:
  - id: check-added-large-files
  - id: check-case-conflict
@@ -18,16 +21,14 @@ repos:
  - id: debug-statements
  - id: destroyed-symlinks
  - id: end-of-file-fixer
    stages: [commit, manual]
    stages: [pre-commit, manual]
  - id: fix-byte-order-marker
  - id: fix-encoding-pragma
    args: [--remove]
  - id: mixed-line-ending
    args: [--fix=lf]
    stages: [commit, manual]
    stages: [pre-commit, manual]
  - id: trailing-whitespace
    exclude_types: [markdown, plain-text]
    stages: [commit, manual]
    stages: [pre-commit, manual]

- repo: https://github.com/jorisroovers/gitlint
  rev: v0.19.1
@@ -35,13 +36,13 @@ repos:
  - id: gitlint

- repo: https://code.kodo.org.uk/dom/pre-commit-hooks
  rev: v0.6.1
  rev: v0.6.3
  hooks:
  - id: check-executable-modes
  - id: check-for-squash
  - id: copyright-notice
    args: [--min-size=1]
    stages: [commit, manual]
    stages: [pre-commit, manual]
  - id: protect-first-parent

- repo: https://github.com/pre-commit/pygrep-hooks
@@ -51,51 +52,42 @@ repos:
  - id: python-no-log-warn
  - id: python-use-type-annotations

- repo: https://github.com/asottile/pyupgrade
  rev: v3.21.2
  hooks:
  - id: pyupgrade

- repo: https://github.com/hakancelikdev/unimport
  rev: 1.2.1
  rev: 1.3.1
  hooks:
  - id: unimport
    args: [--remove, --exclude=types.py|__init__.py]
    stages: [commit, manual]
    stages: [pre-commit, manual]

- repo: https://github.com/pycqa/isort
  rev: 5.13.2
  rev: 8.0.1
  hooks:
  - id: isort
    types: [python]
    stages: [commit, manual]

- repo: https://github.com/asottile/add-trailing-comma
  rev: v3.1.0
  hooks:
  - id: add-trailing-comma
    args: [--py36-plus]
    stages: [commit, manual]
    stages: [pre-commit, manual]

- repo: https://github.com/astral-sh/ruff-pre-commit
  rev: v0.5.5
  rev: v0.15.6
  hooks:
  - id: ruff
  - id: ruff-check
    exclude: "^util/"
    args: [--fix, --unsafe-fixes]
  - id: ruff-format
    stages: [manual]

- repo: https://github.com/pre-commit/mirrors-mypy
  rev: v1.11.1
- repo: https://github.com/RobertCraigie/pyright-python
  rev: v1.1.408
  hooks:
  - id: mypy
    args:
    - --python-version=3.10
    - --follow-imports=silent
    - wpa_supplicant
    pass_filenames: false
  - id: pyright
    additional_dependencies: &type-deps
    - anyio ~=4.0
    - trio-typing

- repo: https://github.com/RobertCraigie/pyright-python
  rev: v1.1.373
  hooks:
  - id: pyright
    args: ["--pythonversion=3.11"]
    stages: ["pre-push", "manual"]
    pass_filenames: false
    additional_dependencies: *type-deps
+7 −5
Original line number Diff line number Diff line
line-length = 92
indent-width = 1  # Used for line length violations

[format]
indent-style = "tab"
skip-magic-trailing-comma = false

[lint]
select = [
	# pyflakes
@@ -61,7 +65,7 @@ select = [
	# --------------

	"UP", "BLE", "FBT", "A", "COM", "C4", "DTZ", "ISC", "LOG", "G", "PIE", "T",
	"Q", "RSE", "RET", "SLF", "SLOT", "SIM", "TD", "ANN", #"FA",
	"Q", "RSE", "RET", "SLOT", "SIM", "TD", "ANN", #"FA",

	# Nice to have, needs fixing in several places though...
	# "EM", "TCH", "PTH", "PGH",
@@ -148,10 +152,6 @@ ignore = [
	# block, leading to false-positives.
	"RET503",

	# DISABLE "Missing type annotation for `%` in {method|classmethod}"
	# Don't type 'self' or 'cls'
	"ANN101", "ANN102",

	# DISABLE "Boolean positional value in function call"
	# Too many stdlib functions take a single positional-only boolean. ruff
	# can't interpret function signatures to ignore these and doesn't understand
@@ -165,6 +165,8 @@ ignore = [

	# Unfortunately a lot of single quotes strings used in this project already
	"Q000",

	"COM812",
]

[lint.per-file-ignores]