diff --git a/.copier-answers.yml b/.copier-answers.yml index 4826e02..9128130 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: v1.12.1 +_commit: v1.13.2 _src_path: https://github.com/hugoh/go-tools.git cog_omit_types: - lint diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d020607..a581893 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,12 +18,12 @@ permissions: {} jobs: hk: - uses: hugoh/go-tools/.github/workflows/go-hk.yml@8d9b10b0bc322952d04b9113c65d4b66a9ddf8cc + uses: hugoh/go-tools/.github/workflows/go-hk.yml@d6a8f57eab49fff4265edb9510782007c2a6c559 permissions: contents: read goci: - uses: hugoh/go-tools/.github/workflows/go-ci.yml@8d9b10b0bc322952d04b9113c65d4b66a9ddf8cc + uses: hugoh/go-tools/.github/workflows/go-ci.yml@d6a8f57eab49fff4265edb9510782007c2a6c559 permissions: contents: read secrets: @@ -31,7 +31,7 @@ jobs: release: needs: [hk, goci] - uses: hugoh/go-tools/.github/workflows/go-release.yml@8d9b10b0bc322952d04b9113c65d4b66a9ddf8cc + uses: hugoh/go-tools/.github/workflows/go-release.yml@d6a8f57eab49fff4265edb9510782007c2a6c559 permissions: contents: write with: diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..8c6aefe --- /dev/null +++ b/biome.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.5.4/schema.json", + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 2 + } +} diff --git a/dprint.json b/dprint.json deleted file mode 100644 index d91e905..0000000 --- a/dprint.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "json": {}, - "markdown": {}, - "toml": {}, - "yaml": {}, - "excludes": [ - ".copier-answers.yml", - "mise.toml" - ], - "plugins": [ - "https://plugins.dprint.dev/json-0.22.0.wasm", - "https://plugins.dprint.dev/markdown-0.22.1.wasm", - "https://plugins.dprint.dev/toml-0.7.0.wasm", - "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.6.0.wasm" - ] -} diff --git a/hk.pkl b/hk.pkl index 4234400..1c56ed5 100644 --- a/hk.pkl +++ b/hk.pkl @@ -1,6 +1,6 @@ amends "package://github.com/jdx/hk/releases/download/v1.51.0/hk@1.51.0#/Config.pkl" import "package://github.com/jdx/hk/releases/download/v1.51.0/hk@1.51.0#/Builtins.pkl" -import "package://github.com/hugoh/hk-config/releases/download/v0.3.2/hk-config@0.3.2#/base.pkl" as Base +import "package://github.com/hugoh/hk-config/releases/download/v1.1.0/hk-config@1.1.0#/base.pkl" as Base min_hk_version = Base.min_hk_version diff --git a/mise-tasks/format b/mise-tasks/format index 197fc24..2f25a58 100755 --- a/mise-tasks/format +++ b/mise-tasks/format @@ -3,4 +3,4 @@ #MISE sources=["**/*.go", "**/*.json", "**/*.md", "**/*.toml", "**/*.yaml", "**/*.yml"] set -e golangci-lint fmt ./... -dprint fmt . --excludes README.md +hk fix --all diff --git a/mise-tasks/lint-deadcode b/mise-tasks/lint-deadcode index 6a15d05..e89a6ed 100755 --- a/mise-tasks/lint-deadcode +++ b/mise-tasks/lint-deadcode @@ -2,7 +2,9 @@ #MISE description="Check for dead code" #MISE sources=["**/*.go"] #USAGE flag "--test" help="Include test files" -if deadcode "${usage_test:+-test}" ./... 2>&1 | grep .; then +flags=() +[ "${usage_test:-}" != "" ] && flags+=(-test) +if deadcode "${flags[@]}" ./... 2>&1 | grep .; then echo 'dead code found' exit 1 fi diff --git a/mise-tasks/lint-go b/mise-tasks/lint-go index 68b85e9..ebb78db 100755 --- a/mise-tasks/lint-go +++ b/mise-tasks/lint-go @@ -2,4 +2,6 @@ #MISE description="Lint Go source" #MISE sources=["**/*.go"] #USAGE flag "--fix" help="Automatically fix issues" -golangci-lint run "${usage_fix:+--fix}" ./... +flags=() +[ "${usage_fix:-}" != "" ] && flags+=(--fix) +golangci-lint run "${flags[@]}" ./... diff --git a/mise.toml b/mise.toml index a705271..67dd264 100644 --- a/mise.toml +++ b/mise.toml @@ -8,7 +8,7 @@ gotestsum = "1.13.0" hk = "1.51.0" rumdl = "0.2.34" zizmor = "1.27.0" -dprint = "0.55.2" +biome = "2.5.4" ghalint = "1.5.6" gitleaks = "8.30.1" actionlint = "1.7.12" diff --git a/testdata/upd_test_bad.toml b/testdata/upd_test_bad.toml index 1b41ac9..09841f3 100644 --- a/testdata/upd_test_bad.toml +++ b/testdata/upd_test_bad.toml @@ -8,7 +8,11 @@ normal = "120s" down = "20s" [checks.list] -ordered = ["http://captive.apple.com/hotspot-detect.html", "ftp://foo.bar/", "dns://8.8.4.4/"] +ordered = [ + "http://captive.apple.com/hotspot-detect.html", + "ftp://foo.bar/", + "dns://8.8.4.4/" +] [downAction] exec = "cowsay"