Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mise.devbase.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ golangci-lint = "2.8.0"
kubeconform = "0.6.4"
shellcheck = "0.11.0"
shfmt = "3.7.0"
tombi = "0.7.27"
"github:getoutreach/lintroller" = "1.19.0"
"go:golang.org/x/tools/cmd/goimports" = "0.5.0"
10 changes: 10 additions & 0 deletions mise.lock
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,13 @@ env = ["devbase"]
version = "3.7.0"
backend = "aqua:mvdan/sh"
env = ["devbase"]

[[tools.tombi]]
version = "0.7.27"
backend = "aqua:tombi-toml/tombi"
env = ["devbase"]
"platforms.linux-arm64" = { checksum = "sha256:87528266b4aabbfa324cc4a60361d308a14b676921f0ebcf12946e19c7174c74", url = "https://github.com/tombi-toml/tombi/releases/download/v0.7.27/tombi-cli-0.7.27-aarch64-unknown-linux-musl.gz"}
"platforms.linux-x64" = { checksum = "sha256:e791f39b44ed78031cdb7c6fc64efd831da2492be1889b737c85412b5794d5ad", url = "https://github.com/tombi-toml/tombi/releases/download/v0.7.27/tombi-cli-0.7.27-x86_64-unknown-linux-musl.gz"}
"platforms.macos-arm64" = { checksum = "sha256:d207e5824065d3b09d6ce4453627744195890b1cdb987d70711b46dfba635c42", url = "https://github.com/tombi-toml/tombi/releases/download/v0.7.27/tombi-cli-0.7.27-aarch64-apple-darwin.gz"}
"platforms.macos-x64" = { checksum = "sha256:2f8144535288ce92bb1ed577cee5b111fe35a5e82c4876e81d143bb81840dd35", url = "https://github.com/tombi-toml/tombi/releases/download/v0.7.27/tombi-cli-0.7.27-x86_64-apple-darwin.gz"}
"platforms.windows-x64" = { checksum = "sha256:ef9c2ff17a5153cb0ebd9bdce72c979f5e0630c36c2f86fc928fc5010443b65e", url = "https://github.com/tombi-toml/tombi/releases/download/v0.7.27/tombi-cli-0.7.27-x86_64-pc-windows-msvc.zip"}
10 changes: 2 additions & 8 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[task_config]
includes = [
".bootstrap/.mise/tasks",
".mise/tasks",
]
includes = [".bootstrap/.mise/tasks", ".mise/tasks"]

[env]
CIRCLECI_ORB_PATH = "orbs/shared"
Expand All @@ -13,9 +10,7 @@ CIRCLECI_ORB_NAME = "getoutreach/shared"
## <</Stencil::Block>>

[hooks]
enter = [
"$MISE_PROJECT_ROOT/scripts/devbase.sh",
]
enter = ["$MISE_PROJECT_ROOT/scripts/devbase.sh"]

## <<Stencil::Block(customMiseHooks)>>

Expand All @@ -24,7 +19,6 @@ enter = [
[tools]
"npm:prettier" = "2"
circleci = "latest"

## <<Stencil::Block(customMiseTools)>>
bats = "latest"
## <</Stencil::Block>>
Expand Down
32 changes: 32 additions & 0 deletions shell/linters/toml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Linters+Formatters for TOML files

# Why: Used by the script that calls us
# shellcheck disable=SC2034
extensions=(toml)

mise_fmt() {
# mise fmt does not take file arguments
mise fmt --all
}

tombi_format() {
find_files_with_extensions "${extensions[@]}" | xargs -n40 "$DIR/tombi.sh" format --quiet
}

tombi_format_check() {
find_files_with_extensions "${extensions[@]}" | xargs -n40 "$DIR/tombi.sh" format --check --quiet
}

tombi_lint() {
find_files_with_extensions "${extensions[@]}" | xargs -n40 "$DIR/tombi.sh" lint
}

linter() {
run_command "tombi format (check)" tombi_format_check || return 1
}

formatter() {
run_command "mise fmt" mise_fmt
run_command "tombi format" tombi_format || return 1
}
12 changes: 12 additions & 0 deletions shell/tombi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# This is a wrapper around mise to run tombi.
# Useful for using the correct version of tombi
# with your editor.
set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"

# shellcheck source=./lib/mise/stub.sh
source "$DIR/lib/mise/stub.sh"

mise_exec_tool tombi "$@"