mirror of
https://github.com/mas-cli/mas
synced 2024-11-22 19:43:09 +00:00
41 lines
930 B
Bash
Executable file
41 lines
930 B
Bash
Executable file
#!/bin/bash -e
|
|
#
|
|
# script/lint
|
|
# mas
|
|
#
|
|
# Linting checks for development and CI.
|
|
#
|
|
# Reports style violations without making any modifications to the code.
|
|
#
|
|
# Please keep in sync with script/format.
|
|
#
|
|
|
|
echo "==> 🚨 Linting mas"
|
|
|
|
for LINTER in git markdownlint periphery shfmt swiftformat swiftlint yamllint; 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 "--> 🕊️ Swift"
|
|
for SOURCE in Package.swift Sources Tests; do
|
|
swiftformat --lint ${SOURCE}
|
|
swift run swift-format lint --recursive ${SOURCE}
|
|
swiftlint lint --strict ${SOURCE}
|
|
done
|
|
periphery scan
|
|
|
|
echo "--> 🌳 Git"
|
|
git diff --check
|
|
|
|
echo "--> 〽️ Markdown"
|
|
markdownlint --config .markdownlint.json .github .
|
|
|
|
echo "--> 🖊 YAML"
|
|
yamllint .
|
|
|
|
echo "--> 📜 Bash"
|
|
shellcheck --shell=bash script/*
|
|
shfmt -d -i 2 -l contrib/ script/
|