mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-21 15:10:27 +00:00
tidy: Check TOML format
This commit is contained in:
9
.taplo.toml
Normal file
9
.taplo.toml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Taplo configuration
|
||||||
|
# https://taplo.tamasfe.dev/configuration/formatter-options.html
|
||||||
|
|
||||||
|
[formatting]
|
||||||
|
align_comments = false
|
||||||
|
allowed_blank_lines = 1
|
||||||
|
array_auto_collapse = false
|
||||||
|
array_auto_expand = false
|
||||||
|
indent_string = " "
|
||||||
@@ -238,6 +238,21 @@ if [[ -n "$(git ls-files '*.yaml')" ]]; then
|
|||||||
git ls-files '*.yaml'
|
git ls-files '*.yaml'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# TOML (if exists)
|
||||||
|
if [[ -n "$(git ls-files '*.toml')" ]]; then
|
||||||
|
info "checking TOML style"
|
||||||
|
if [[ ! -e .taplo.toml ]]; then
|
||||||
|
warn "could not found .taplo.toml in the repository root"
|
||||||
|
fi
|
||||||
|
if type -P npm &>/dev/null; then
|
||||||
|
echo "+ npx -y @taplo/cli fmt \$(git ls-files '*.toml')"
|
||||||
|
npx -y @taplo/cli fmt $(git ls-files '*.toml')
|
||||||
|
check_diff $(git ls-files '*.toml')
|
||||||
|
else
|
||||||
|
warn "'npm' is not installed; skipped TOML style check"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Markdown (if exists)
|
# Markdown (if exists)
|
||||||
if [[ -n "$(git ls-files '*.md')" ]]; then
|
if [[ -n "$(git ls-files '*.md')" ]]; then
|
||||||
info "checking Markdown style"
|
info "checking Markdown style"
|
||||||
|
|||||||
Reference in New Issue
Block a user