2022-09-06 15:48:01 +12:00
|
|
|
---
|
2020-01-14 09:35:55 +11:00
|
|
|
# See https://pre-commit.com for more information
|
|
|
|
|
# See https://pre-commit.com/hooks.html for more hooks
|
2025-07-13 12:44:21 -10:00
|
|
|
|
|
|
|
|
ci:
|
|
|
|
|
autoupdate_commit_msg: 'pre-commit: autoupdate'
|
2025-07-13 17:30:34 -10:00
|
|
|
autoupdate_schedule: off # Disabled until ruff versions are synced between deps and pre-commit
|
2025-07-13 12:44:21 -10:00
|
|
|
# Skip hooks that have issues in pre-commit CI environment
|
2025-07-14 14:52:03 -10:00
|
|
|
skip: [pylint, clang-tidy-hash]
|
2025-07-13 12:44:21 -10:00
|
|
|
|
2020-01-14 09:35:55 +11:00
|
|
|
repos:
|
2024-07-23 14:12:23 +10:00
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
|
|
|
# Ruff version.
|
2026-01-16 20:29:02 +00:00
|
|
|
rev: v0.14.13
|
2024-07-23 14:12:23 +10:00
|
|
|
hooks:
|
|
|
|
|
# Run the linter.
|
|
|
|
|
- id: ruff
|
|
|
|
|
args: [--fix]
|
|
|
|
|
# Run the formatter.
|
|
|
|
|
- id: ruff-format
|
2022-11-07 19:03:59 +13:00
|
|
|
- repo: https://github.com/PyCQA/flake8
|
2025-06-22 19:05:54 +00:00
|
|
|
rev: 7.3.0
|
2021-03-07 16:03:16 -03:00
|
|
|
hooks:
|
|
|
|
|
- id: flake8
|
|
|
|
|
additional_dependencies:
|
2025-04-06 00:58:39 +00:00
|
|
|
- flake8-docstrings==1.7.0
|
2021-03-07 16:03:16 -03:00
|
|
|
- pydocstyle==5.1.1
|
|
|
|
|
files: ^(esphome|tests)/.+\.py$
|
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2025-07-14 14:25:18 -10:00
|
|
|
rev: v5.0.0
|
2021-03-07 16:03:16 -03:00
|
|
|
hooks:
|
|
|
|
|
- id: no-commit-to-branch
|
|
|
|
|
args:
|
|
|
|
|
- --branch=dev
|
2021-07-02 15:42:36 +02:00
|
|
|
- --branch=release
|
2021-03-07 16:03:16 -03:00
|
|
|
- --branch=beta
|
2025-07-14 14:25:18 -10:00
|
|
|
- id: end-of-file-fixer
|
|
|
|
|
- id: trailing-whitespace
|
2022-02-10 21:55:11 +13:00
|
|
|
- repo: https://github.com/asottile/pyupgrade
|
2025-05-26 08:13:45 +00:00
|
|
|
rev: v3.20.0
|
2022-02-10 21:55:11 +13:00
|
|
|
hooks:
|
|
|
|
|
- id: pyupgrade
|
2025-07-15 15:20:58 -10:00
|
|
|
args: [--py311-plus]
|
2024-04-23 08:10:07 +10:00
|
|
|
- repo: https://github.com/adrienverge/yamllint.git
|
2025-05-08 10:19:23 +12:00
|
|
|
rev: v1.37.1
|
2024-04-23 08:10:07 +10:00
|
|
|
hooks:
|
|
|
|
|
- id: yamllint
|
2025-07-14 14:25:18 -10:00
|
|
|
exclude: ^(\.clang-format|\.clang-tidy)$
|
2024-04-23 08:10:07 +10:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
|
|
|
|
rev: v13.0.1
|
|
|
|
|
hooks:
|
|
|
|
|
- id: clang-format
|
2024-04-24 14:49:16 +12:00
|
|
|
types_or: [c, c++]
|
2024-05-13 07:56:55 +10:00
|
|
|
- repo: local
|
|
|
|
|
hooks:
|
|
|
|
|
- id: pylint
|
|
|
|
|
name: pylint
|
2025-02-10 05:12:46 +01:00
|
|
|
entry: python3 script/run-in-env.py pylint
|
2025-01-16 15:10:20 -05:00
|
|
|
language: system
|
2024-05-13 07:56:55 +10:00
|
|
|
types: [python]
|
2025-07-09 11:00:44 -10:00
|
|
|
- id: clang-tidy-hash
|
|
|
|
|
name: Update clang-tidy hash
|
|
|
|
|
entry: python script/clang_tidy_hash.py --update-if-changed
|
|
|
|
|
language: python
|
|
|
|
|
files: ^(\.clang-tidy|platformio\.ini|requirements_dev\.txt)$
|
|
|
|
|
pass_filenames: false
|
|
|
|
|
additional_dependencies: []
|