Skip to content

Commit e1af94e

Browse files
committed
pre-commit: Use google/yamlfmt instead of Prettier (unmaintained)
1 parent ae958dd commit e1af94e

File tree

7 files changed

+78
-96
lines changed

7 files changed

+78
-96
lines changed

.github/workflows/dependency-audit.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ jobs:
2828
- uses: EmbarkStudios/cargo-deny-action@v2
2929
with:
3030
command: check
31-
arguments: >-
31+
arguments: |-
3232
--all-features
3333
--locked

.github/workflows/pre-release.yaml

+14-14
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ jobs:
3939
steps:
4040
- name: Install dependencies for `musl libc` on Linux
4141
if: matrix.target == 'x86_64-unknown-linux-musl'
42-
run: >+
43-
sudo apt update && \
44-
sudo apt -y install \
42+
run: |-
43+
sudo apt update &&
44+
sudo apt -y install
4545
musl-tools
4646
4747
# See also: <https://github.com/emilk/egui/blob/master/.github/workflows/rust.yml>
4848
- name: Install dependencies for `egui` on Linux
4949
if: runner.os == 'Linux'
50-
run: >+
51-
sudo apt update && \
52-
sudo apt -y install \
53-
libgtk-3-dev \
54-
libssl-dev \
55-
libxcb-render0-dev \
56-
libxcb-shape0-dev \
57-
libxcb-xfixes0-dev \
50+
run: |-
51+
sudo apt update &&
52+
sudo apt -y install
53+
libgtk-3-dev
54+
libssl-dev
55+
libxcb-render0-dev
56+
libxcb-shape0-dev
57+
libxcb-xfixes0-dev
5858
libxkbcommon-dev
5959
6060
# See also: <https://github.com/rusqlite/rusqlite/blob/master/.github/workflows/main.yml>
@@ -83,13 +83,13 @@ jobs:
8383

8484
- name: Prepare artifact on Linux/macOS
8585
if: runner.os != 'Windows'
86-
run: >+
86+
run: |
8787
cd target/${{ matrix.target }}/${{ matrix.build_profile }}
8888
tar cJvf ../../../${{ matrix.build_package }}-${{ matrix.target }}${{ matrix.artifact_suffix }} ${{ matrix.build_package }}
8989
cd -
9090
- name: Prepare artifact on Windows
9191
if: runner.os == 'Windows'
92-
run: >+
92+
run: |
9393
cd target/${{ matrix.target }}/${{ matrix.build_profile }}
9494
7z a ../../../${{ matrix.build_package }}-${{ matrix.target }}${{ matrix.artifact_suffix }} ${{ matrix.build_package }}.exe
9595
cd -
@@ -116,7 +116,7 @@ jobs:
116116
uses: actions/download-artifact@v4
117117

118118
- name: Generate artifact checksums
119-
run: >-
119+
run: |-
120120
for file in ${{ matrix.build_package }}-*/${{ matrix.build_package }}-*;
121121
do
122122
openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256";

.github/workflows/test.yaml

+37-37
Original file line numberDiff line numberDiff line change
@@ -89,30 +89,30 @@ jobs:
8989
shared-key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.target }}
9090

9191
- name: Check aoide-core
92-
run: >-
93-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
92+
run: |-
93+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
9494
--manifest-path crates/core/Cargo.toml
9595
9696
- name: Check aoide-core-json
97-
run: >-
98-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
97+
run: |-
98+
ccargo check --locked --all-targets --all-features --target ${{ matrix.target }}
9999
--manifest-path crates/core-json/Cargo.toml
100100
101101
- name: Check aoide-core-api
102-
run: >-
103-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
102+
run: |-
103+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
104104
--manifest-path crates/core-api/Cargo.toml
105105
106106
- name: Check aoide-core-api-json
107-
run: >-
108-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
107+
run: |-
108+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
109109
--manifest-path crates/core-api-json/Cargo.toml
110110
111111
- name: Check aoide-desktop-app
112112
# TODO: Re-enable after cross-compilation issues for wayland-sys have been fixed.
113113
if: false
114-
run: >-
115-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
114+
run: |-
115+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
116116
--manifest-path crates/desktop-app/Cargo.toml
117117
118118
- name: Check aoide-media
@@ -121,73 +121,73 @@ jobs:
121121
--manifest-path crates/media-file/Cargo.toml
122122
123123
- name: Check aoide-repo
124-
run: >-
125-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
124+
run: |-
125+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
126126
--manifest-path crates/repo/Cargo.toml
127127
128128
- name: Check aoide-repo-sqlite
129-
run: >-
130-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
129+
run: |-
130+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
131131
--manifest-path crates/repo-sqlite/Cargo.toml
132132
133133
- name: Check aoide-storage-sqlite
134-
run: >-
135-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
134+
run: |-
135+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
136136
--manifest-path crates/storage-sqlite/Cargo.toml
137137
138138
- name: Check aoide-search-index-tantivy
139-
run: >-
140-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
139+
run: |-
140+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
141141
--manifest-path crates/search-index-tantivy/Cargo.toml
142142
143143
- name: Check aoide-usecases
144-
run: >-
145-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
144+
run: |-
145+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
146146
--manifest-path crates/usecases/Cargo.toml
147147
148148
- name: Check aoide-usecases-sqlite
149-
run: >-
150-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
149+
run: |-
150+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
151151
--manifest-path crates/usecases-sqlite/Cargo.toml
152152
153153
- name: Check aoide-backend-embedded
154-
run: >-
155-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
154+
run: |-
155+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
156156
--manifest-path crates/backend-embedded/Cargo.toml
157157
158158
- name: Check aoide-backend-webapi-json
159-
run: >-
160-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
159+
run: |-
160+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
161161
--manifest-path crates/backend-webapi-json/Cargo.toml
162162
163163
- name: Check aoide-websrv-warp-sqlite
164-
run: >-
165-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
164+
run: |-
165+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
166166
--manifest-path crates/websrv-warp-sqlite/Cargo.toml
167167
168168
- name: Check aoide-websrv
169-
run: >-
170-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
169+
run: |-
170+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
171171
--manifest-path websrv/Cargo.toml
172172
173173
- name: Check aoide-file-collection-app
174-
run: >-
175-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
174+
run: |-
175+
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
176176
--manifest-path file-collection-app/Cargo.toml
177177
178178
- name: Build tests with all features enabled
179-
run: >-
180-
cargo test --locked --target ${{ matrix.target }} --workspace --all-features
179+
run: |-
180+
cargo check --locked --workspace --all-features --target ${{ matrix.target }}
181181
--no-run
182182
183183
- name: Run tests with all features enabled
184184
if: matrix.runnable
185-
run: >-
186-
cargo test --locked --target ${{ matrix.target }} --workspace --all-features
185+
run: |-
186+
cargo check --locked --workspace --all-features --target ${{ matrix.target }}
187187
-- --nocapture --quiet
188188
189189
- name: Run doctests with all features enabled (only on default target)
190190
if: matrix.default_target
191-
run: >-
191+
run: |-
192192
cargo test --locked --workspace --all-features
193193
--doc

.pre-commit-config.yaml

+12-14
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ repos:
4949
# Differs from default_stages (see above)
5050
- commit-msg
5151
- repo: https://github.com/DavidAnson/markdownlint-cli2
52-
rev: v0.17.1
52+
rev: v0.17.2
5353
hooks:
5454
- id: markdownlint-cli2
5555
exclude: ^LICENSE\.md$
@@ -61,24 +61,32 @@ repos:
6161
rev: v2.3.0
6262
hooks:
6363
- id: codespell
64+
# JSON
6465
- repo: https://github.com/sirosen/check-jsonschema
6566
rev: 0.31.0
6667
hooks:
6768
- id: check-github-actions
6869
- id: check-github-workflows
70+
# Markdown
71+
# TODO: Remove unmaintained Prettier plugin.
6972
- repo: https://github.com/pre-commit/mirrors-prettier
7073
rev: v3.1.0
7174
hooks:
7275
- id: prettier
7376
types_or:
74-
- yaml
7577
- markdown
78+
# YAML
79+
- repo: https://github.com/google/yamlfmt
80+
rev: v0.15.0
81+
hooks:
82+
- id: yamlfmt
83+
# TOML
7684
- repo: https://github.com/ComPWA/taplo-pre-commit
7785
rev: v0.9.3
7886
hooks:
7987
- id: taplo-format
8088
- id: taplo-lint
81-
# https://reuse.software
89+
# Licensing: https://reuse.software
8290
- repo: https://github.com/fsfe/reuse-tool
8391
rev: v5.0.2
8492
hooks:
@@ -89,17 +97,7 @@ repos:
8997
- id: fmt
9098
args: [--all, --]
9199
- id: clippy
92-
args:
93-
[
94-
--locked,
95-
--workspace,
96-
--all-features,
97-
--all-targets,
98-
--no-deps,
99-
--,
100-
-D,
101-
warnings,
102-
]
100+
args: [--locked, --workspace, --all-features, --all-targets, --no-deps, --, -D, warnings]
103101
- repo: local
104102
hooks:
105103
- id: cargo-doc

.yamlfmt

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-FileCopyrightText: Copyright (C) 2018-2025 Uwe Klotz <uwedotklotzatgmaildotcom> et al.
2+
# SPDX-License-Identifier: CC0-1.0
3+
4+
formatter:
5+
type: basic
6+
retain_line_breaks_single: true
7+
scan_folded_as_literal: true
8+
trim_trailing_whitespace: true
9+
# TODO: Missing option from Prettier config.
10+
# Enforce double quotes which allow to use escapes.
11+
# singleQuote: false

websrv/res/.spectral.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Configuration file for https://stoplight.io/open-source/spectral
55

6-
extends: [[spectral:oas, all]]
6+
extends: [["spectral:oas", all]]
77
rules:
88
contact-properties: false
99
tag-description: false

websrv/res/openapi.yaml

+2-29
Original file line numberDiff line numberDiff line change
@@ -1767,34 +1767,7 @@ components:
17671767
$ref: "#/components/schemas/MovementIndex"
17681768
KeySignatureCode:
17691769
type: integer
1770-
enum:
1771-
[
1772-
0,
1773-
1,
1774-
2,
1775-
3,
1776-
4,
1777-
5,
1778-
6,
1779-
7,
1780-
8,
1781-
9,
1782-
10,
1783-
11,
1784-
12,
1785-
13,
1786-
14,
1787-
15,
1788-
16,
1789-
17,
1790-
18,
1791-
19,
1792-
20,
1793-
21,
1794-
22,
1795-
23,
1796-
24,
1797-
]
1770+
enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
17981771
description: |
17991772
The key signature is denoted by a code with one of the following values:
18001773
* 0 = Off key
@@ -3673,6 +3646,6 @@ components:
36733646
minimum: 10000
36743647
maximum: 99999999
36753648
example: 20191124
3676-
description: |
3649+
description: |-
36773650
An 8-digit integer representing a naive date without any time zone information:
36783651
YyyyMmDdDateValue = YYYY (year, 4-digits) + MM (month, 2-digits) + DD (day of month, 2 digits):

0 commit comments

Comments
 (0)