2023-01-19 14:08:49 +01:00
|
|
|
# Pre-commit hooks to run tests and ensure code is cleaned.
|
|
|
|
# See https://pre-commit.com for more information
|
2024-01-22 01:49:05 +01:00
|
|
|
---
|
2023-01-19 14:08:49 +01:00
|
|
|
repos:
|
2024-01-22 01:49:05 +01:00
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
|
|
rev: v0.1.6
|
|
|
|
hooks:
|
|
|
|
- id: ruff
|
2024-03-13 23:33:46 +01:00
|
|
|
args: ["--fix"]
|
2024-01-22 01:49:05 +01:00
|
|
|
- repo: https://github.com/asottile/pyupgrade
|
2024-03-13 23:33:46 +01:00
|
|
|
rev: v3.15.0
|
2024-01-22 01:49:05 +01:00
|
|
|
hooks:
|
|
|
|
- id: pyupgrade
|
|
|
|
args: ["--keep-percent-format", "--py37-plus"]
|
|
|
|
- repo: https://github.com/psf/black
|
2024-03-13 23:33:46 +01:00
|
|
|
rev: 23.11.0
|
2024-01-22 01:49:05 +01:00
|
|
|
hooks:
|
|
|
|
- id: black
|
|
|
|
args: ["--target-version", "py37", "--line-length", "100"]
|
|
|
|
- repo: https://github.com/PyCQA/isort
|
2024-03-13 23:33:46 +01:00
|
|
|
rev: 5.12.0
|
2024-01-22 01:49:05 +01:00
|
|
|
hooks:
|
|
|
|
- id: isort
|
|
|
|
args: ["--profile", "black", "--line-length", "100"]
|
|
|
|
- repo: https://github.com/PyCQA/flake8
|
2024-03-13 23:33:46 +01:00
|
|
|
rev: 6.1.0
|
2024-01-22 01:49:05 +01:00
|
|
|
hooks:
|
|
|
|
- id: flake8
|
|
|
|
args: ["--max-line-length=100"]
|
|
|
|
- repo: https://github.com/codespell-project/codespell
|
|
|
|
rev: v2.2.2
|
|
|
|
hooks:
|
|
|
|
- id: codespell
|
|
|
|
args:
|
|
|
|
- --ignore-words-list=fro,hass
|
|
|
|
- --skip="./.*,*.csv,*.json,*.ambr"
|
|
|
|
- --quiet-level=2
|
2024-03-13 23:33:46 +01:00
|
|
|
- --ignore-regex=.*codespell-ignore$
|
|
|
|
# - --write-changes # Uncomment to write changes
|
2024-01-22 01:49:05 +01:00
|
|
|
exclude_types: [csv, json]
|
|
|
|
- repo: https://github.com/adrienverge/yamllint
|
|
|
|
rev: v1.32.0
|
|
|
|
hooks:
|
|
|
|
- id: yamllint
|
|
|
|
args: ["-d {extends: relaxed, rules: {line-length: disable}}", "-s"]
|
|
|
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
|
|
rev: v2.7.1
|
|
|
|
hooks:
|
|
|
|
- id: prettier
|
2024-03-13 23:33:46 +01:00
|
|
|
args: ["--print-width", "100"]
|
2024-01-22 01:49:05 +01:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: pylint
|
|
|
|
name: pylint
|
|
|
|
entry: pylint
|
|
|
|
language: system
|
|
|
|
types: [python]
|
|
|
|
require_serial: true
|
2024-03-13 23:33:46 +01:00
|
|
|
- repo: https://github.com/PyCQA/bandit
|
|
|
|
rev: 1.7.5
|
2024-01-22 01:49:05 +01:00
|
|
|
hooks:
|
2024-03-13 23:33:46 +01:00
|
|
|
- id: bandit
|
|
|
|
args: [--skip, "B101", --recursive]
|
|
|
|
|
2024-01-22 01:49:05 +01:00
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
|
|
rev: v4.4.0
|
|
|
|
hooks:
|
|
|
|
- id: check-executables-have-shebangs
|
|
|
|
stages: [manual]
|
2024-03-13 23:33:46 +01:00
|
|
|
minimum_pre_commit_version: 3.2.0
|