diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 514277351..a91fd3042 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -19,6 +19,9 @@ jobs: run: | yamllint --format github --strict \ device-types/ module-types/ + - name: Format YAML files (hooks) + run: | + pre-commit run --config .pre-commit-hooks-config.yaml --all-files - name: Format YAML files (yamlfmt) run: | pre-commit run --config .pre-commit-yamlfmt-config.yaml --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62a21519a..fb5ae7a9c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,19 +2,19 @@ files: ^(device-types|module-types)/ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml name: Check YAML files - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt - rev: 0.2.2 + rev: 0.2.3 hooks: - id: yamlfmt args: [--mapping, '2', --sequence, '4', --offset, '2'] - repo: https://github.com/adrienverge/yamllint.git - rev: v1.27.1 + rev: v1.31.0 hooks: - id: yamllint name: Lint YAML files diff --git a/.pre-commit-hooks-config.yaml b/.pre-commit-hooks-config.yaml new file mode 100644 index 000000000..5c2269917 --- /dev/null +++ b/.pre-commit-hooks-config.yaml @@ -0,0 +1,10 @@ +--- +files: ^(device-types|module-types)/ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + name: Check YAML files \ No newline at end of file diff --git a/.pre-commit-yamlfmt-config.yaml b/.pre-commit-yamlfmt-config.yaml index 8441d44fc..c22135590 100644 --- a/.pre-commit-yamlfmt-config.yaml +++ b/.pre-commit-yamlfmt-config.yaml @@ -1,15 +1,8 @@ --- files: ^(device-types|module-types)/ repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - name: Check YAML files - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt - rev: 0.2.2 + rev: 0.2.3 hooks: - id: yamlfmt args: [--mapping, '2', --sequence, '4', --offset, '2'] diff --git a/requirements.txt b/requirements.txt index 2961087c1..214f3799c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ jsonschema==4.17.3 -pre-commit==3.2.1 -pytest==7.2.2 +pre-commit==3.2.2 +pytest==7.3.1 PyYAML==6.0 -yamllint==1.30.0 +yamllint==1.31.0