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 <patrick@stwcx.xyz>
Change-Id: I6ad7b24ca02ca86ddb3c45cb1b14f459349ad8ab
diff --git a/scripts/format-code.sh b/scripts/format-code.sh
index 43a3278..09e43dd 100755
--- a/scripts/format-code.sh
+++ b/scripts/format-code.sh
@@ -35,6 +35,7 @@
flake8 \
isort \
markdownlint \
+ meson \
prettier \
shellcheck \
)
@@ -257,6 +258,12 @@
# We disable line-length because prettier should handle prose wrap for us.
}
+LINTER_REQUIRE+=([meson]="meson;meson.build")
+LINTER_TYPES+=([meson]="meson")
+function do_meson() {
+ meson format -i "$@"
+}
+
LINTER_REQUIRE+=([prettier]="prettier;.prettierrc.yaml;${CONFIG_PATH}/prettierrc.yaml")
LINTER_IGNORE+=([prettier]=".prettierignore")
LINTER_TYPES+=([prettier]="json;markdown;yaml")
@@ -297,6 +304,7 @@
# Special files.
.git/COMMIT_EDITMSG) echo "commit" && return ;;
meson.build) echo "meson" && return ;;
+ meson.options) echo "meson" && return ;;
esac
case "$(file "$1")" in