forked from esphome/device-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
58 lines (58 loc) · 2.12 KB
/
.pre-commit-config.yaml
File metadata and controls
58 lines (58 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: local
hooks:
- id: validate-definitions
name: validate board/component definitions
entry: python script/validate_definitions.py
language: python
additional_dependencies: [pyyaml, jsonschema]
pass_filenames: false
files: ^esphome_device_builder/definitions/
types: [yaml]
- id: sync-boards
name: regenerate boards.json from manifests
entry: python script/sync_boards.py
language: python
# ``voluptuous`` is needed because importing
# ``esphome_device_builder.models.remote_build`` (transitively
# imported via the script's models import chain) builds the
# ``StoredPairing`` ``vol.Schema`` at module-load time. The
# schema only *runs* later, in ``__post_init__``, but the
# ``import voluptuous as vol`` at the top of the module
# fails without the dep installed in the hook's slim env.
additional_dependencies: [pyyaml, orjson, mashumaro, voluptuous]
pass_filenames: false
files: ^esphome_device_builder/definitions/boards/.*\.yaml$
types: [yaml]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-toml
- id: check-yaml
# Test fixtures intentionally contain ESPHome-specific
# custom tags (``!secret``, ``!include``) that the plain
# PyYAML loader can't resolve. The fixtures are read as
# raw text by the YAML-search code path under test, not
# parsed.
exclude: ^tests/fixtures/
- id: check-json
exclude: ^\.vscode/
- id: check-ast
- id: check-case-conflict
- id: check-merge-conflict
- id: detect-private-key
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
exclude: ^esphome_device_builder/definitions/
additional_dependencies:
- tomli