mirror of
https://github.com/mas-cli/mas
synced 2024-11-22 11:33:13 +00:00
4848f422d6
Fixes #364.
39 lines
903 B
Bash
Executable file
39 lines
903 B
Bash
Executable file
#!/bin/bash -e
|
|
#
|
|
# script/format
|
|
# mas
|
|
#
|
|
# Linting checks for development and CI.
|
|
#
|
|
# Automatically formats and fixes style violations using various tools.
|
|
# Additionally runs `lint` to report any remaining style violations.
|
|
#
|
|
# Please keep in sync with script/lint.
|
|
#
|
|
|
|
echo "==> 🚨 Formatting mas"
|
|
|
|
for LINTER in markdownlint shfmt swiftformat swiftlint; do
|
|
if [[ ! -x "$(command -v ${LINTER})" ]]; then
|
|
echo "error: ${LINTER} is not installed. Run 'script/bootstrap' or 'brew install ${LINTER}'."
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
echo
|
|
echo "--> 🖊 Markdown"
|
|
markdownlint --config .markdownlint.json --fix .github .
|
|
|
|
echo
|
|
echo "--> 🕊️ Swift"
|
|
for SOURCE in Package.swift Sources Tests; do
|
|
swiftformat ${SOURCE}
|
|
swift run swift-format format --in-place --recursive ${SOURCE}
|
|
swiftlint lint --fix --strict ${SOURCE}
|
|
done
|
|
|
|
echo
|
|
echo "--> 📜 Bash"
|
|
shfmt -i 2 -l -w contrib/ script/
|
|
|
|
script/lint
|