Skip to content

Commit 1ef5c60

Browse files
format-code: enable meson format linting
Meson has a format utility built-in now. Use this to format both meson.build and meson.option files so we have consistent formatting. Signed-off-by: Patrick Williams <[email protected]> Change-Id: I6ad7b24ca02ca86ddb3c45cb1b14f459349ad8ab
1 parent 5b1afd9 commit 1ef5c60

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/format-code.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ LINTERS_ALL=( \
3535
flake8 \
3636
isort \
3737
markdownlint \
38+
meson \
3839
prettier \
3940
shellcheck \
4041
)
@@ -257,6 +258,12 @@ function do_markdownlint() {
257258
# We disable line-length because prettier should handle prose wrap for us.
258259
}
259260

261+
LINTER_REQUIRE+=([meson]="meson;meson.build")
262+
LINTER_TYPES+=([meson]="meson")
263+
function do_meson() {
264+
meson format -i "$@"
265+
}
266+
260267
LINTER_REQUIRE+=([prettier]="prettier;.prettierrc.yaml;${CONFIG_PATH}/prettierrc.yaml")
261268
LINTER_IGNORE+=([prettier]=".prettierignore")
262269
LINTER_TYPES+=([prettier]="json;markdown;yaml")
@@ -297,6 +304,7 @@ function get_file_type()
297304
# Special files.
298305
.git/COMMIT_EDITMSG) echo "commit" && return ;;
299306
meson.build) echo "meson" && return ;;
307+
meson.options) echo "meson" && return ;;
300308
esac
301309

302310
case "$(file "$1")" in

0 commit comments

Comments
 (0)