summaryrefslogtreecommitdiff
path: root/.pre-commit-config.yaml
blob: 5f7fc8c12ac14415c6065579e143b993ad4083b4 (plain)
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
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
#
# SPDX-License-Identifier: Unlicense

repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
    -   id: check-yaml
    -   id: end-of-file-fixer
        exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/esp32s2/esp-idf-config/.*|ports/esp32s2/boards/.*/sdkconfig)'
    -   id: trailing-whitespace
        exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)'
-   repo: local
    hooks:
    -   id: translations
        name: Translations
        entry: sh -c "if ! make check-translate; then make translate; fi"
        types: [c]
        pass_filenames: false
        language: system
    -   id: formatting
        name: Formatting
        entry: sh -c "git diff --staged --name-only | xargs python3 tools/codeformat.py"
        types_or: [c, python]
        language: system