From 8209ea8aa263ebd63389831f4759bf06fada650e Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:13:35 -0500 Subject: [PATCH 01/11] fix: simplify CI and testing infrastructure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove unnecessary options from mise-action - Use mise to install lua instead of apt - Remove release workflow - Simplify lint and test tasks to inline commands in mise.toml - Remove separate script files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/ci.yml | 78 ++------------------- .github/workflows/release.yml | 32 --------- mise.toml | 25 ++++--- scripts/lint.sh | 125 ---------------------------------- scripts/test.sh | 113 ------------------------------ 5 files changed, 20 insertions(+), 353 deletions(-) delete mode 100644 .github/workflows/release.yml delete mode 100755 scripts/lint.sh delete mode 100755 scripts/test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a1999f..0c89c0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,21 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - - name: Install mise - uses: jdx/mise-action@v2 - with: - version: latest - install: true - - - name: Install dependencies - run: | - mise install - sudo apt-get update - sudo apt-get install -y lua5.4 - - - name: Run linter - run: mise run lint + - uses: jdx/mise-action@v2 + - run: mise run lint test: strategy: @@ -35,62 +22,5 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - - name: Install mise - uses: jdx/mise-action@v2 - with: - version: latest - install: true - - - name: Install Lua (Ubuntu) - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y lua5.4 - - - name: Install Lua (macOS) - if: runner.os == 'macOS' - run: | - brew install lua - - - name: Run tests - run: | - mise install - mise run test - - integration-test: - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - semver-version: ['3.4.0', '3.3.0', '3.2.0'] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - - name: Install mise - uses: jdx/mise-action@v2 - with: - version: latest - install: true - - - name: Test plugin installation - run: | - # Install the plugin from current directory - mise plugin install semver . - - # List available versions - mise ls-remote semver | head -20 - - # Install specific version - mise install semver@${{ matrix.semver-version }} - - # Test execution - mise exec semver@${{ matrix.semver-version }} -- semver --version - - # Test basic functionality - mise exec semver@${{ matrix.semver-version }} -- semver bump major 1.2.3 | grep -q "2.0.0" - mise exec semver@${{ matrix.semver-version }} -- semver bump minor 1.2.3 | grep -q "1.3.0" - mise exec semver@${{ matrix.semver-version }} -- semver bump patch 1.2.3 | grep -q "1.2.4" - - # Clean up - mise plugin uninstall semver \ No newline at end of file + - uses: jdx/mise-action@v2 + - run: mise run test \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 005255e..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Release - -on: - push: - tags: - - 'v*' - workflow_dispatch: - -jobs: - release: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - - - name: Create Release - uses: softprops/action-gh-release@v1 - with: - draft: false - prerelease: false - generate_release_notes: true - body: | - ## Installation - - ```bash - mise plugin install semver https://github.com/mise-plugins/mise-semver - ``` - - ## What's Changed - - See the auto-generated release notes below for details. \ No newline at end of file diff --git a/mise.toml b/mise.toml index c9950c5..bc356c8 100644 --- a/mise.toml +++ b/mise.toml @@ -1,20 +1,27 @@ [tools] semver = "3.4.0" shellcheck = "latest" -shfmt = "latest" +lua = "5.4" [tasks.test] description = "Run plugin tests" -run = "./scripts/test.sh" +run = """ + mise plugin uninstall semver 2>/dev/null || true + mise plugin link semver . + mise cache clear + MISE_USE_VERSIONS=0 mise exec semver -- semver --version | grep -q '3.4.0' + echo "✓ Tests passed" +""" [tasks.lint] -description = "Lint shell and Lua scripts" -run = "./scripts/lint.sh" - -[tasks."lint:fix"] -description = "Lint and fix shell scripts" -run = "shfmt -w scripts/*.sh" +description = "Lint Lua scripts" +run = """ + for f in metadata.lua hooks/*.lua; do + lua -e "loadfile('$f')" 2>&1 | grep -q "syntax error" && echo "✗ $f has syntax errors" && exit 1 || true + done + echo "✓ Lint passed" +""" [tasks.ci] description = "Run all CI checks" -depends = ["lint", "test"] +depends = ["lint", "test"] \ No newline at end of file diff --git a/scripts/lint.sh b/scripts/lint.sh deleted file mode 100755 index 9280cf6..0000000 --- a/scripts/lint.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Colors for output -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -NC='\033[0m' # No Color - -# Lint status -LINT_PASSED=true - -# Helper functions -info() { - echo -e "${GREEN}[INFO]${NC} $1" -} - -error() { - echo -e "${RED}[ERROR]${NC} $1" - LINT_PASSED=false -} - -warning() { - echo -e "${YELLOW}[WARNING]${NC} $1" -} - -info "Starting linting checks" - -# Check shell scripts with shellcheck -if command -v shellcheck >/dev/null 2>&1; then - info "Checking shell scripts with shellcheck..." - - for script in scripts/*.sh; do - if [ -f "$script" ]; then - echo -n " Checking $(basename "$script")... " - if shellcheck "$script"; then - echo -e "${GREEN}✓${NC}" - else - echo -e "${RED}✗${NC}" - LINT_PASSED=false - fi - fi - done -else - warning "shellcheck not found, install with: mise install shellcheck" -fi - -# Check shell script formatting with shfmt -if command -v shfmt >/dev/null 2>&1; then - info "Checking shell script formatting with shfmt..." - - for script in scripts/*.sh; do - if [ -f "$script" ]; then - echo -n " Checking $(basename "$script")... " - if shfmt -d "$script" >/dev/null 2>&1; then - echo -e "${GREEN}✓${NC}" - else - echo -e "${RED}✗${NC} (run 'mise run lint:fix' to fix)" - LINT_PASSED=false - fi - fi - done -else - warning "shfmt not found, install with: mise install shfmt" -fi - -# Check Lua syntax -if command -v luac >/dev/null 2>&1; then - info "Checking Lua syntax..." - - # Check all Lua files - for lua_file in metadata.lua hooks/*.lua; do - if [ -f "$lua_file" ]; then - echo -n " Checking $(basename "$lua_file")... " - if luac -p "$lua_file" 2>/dev/null; then - echo -e "${GREEN}✓${NC}" - else - echo -e "${RED}✗${NC}" - luac -p "$lua_file" - LINT_PASSED=false - fi - fi - done -else - warning "luac not found, skipping Lua syntax checks" -fi - -# Check for common issues in Lua files -info "Checking for common Lua issues..." - -# Check for consistent indentation (4 spaces) -for lua_file in metadata.lua hooks/*.lua; do - if [ -f "$lua_file" ]; then - echo -n " Checking indentation in $(basename "$lua_file")... " - if ! grep -q $'^\t' "$lua_file"; then - echo -e "${GREEN}✓${NC}" - else - echo -e "${RED}✗${NC} (found tabs, use 4 spaces)" - LINT_PASSED=false - fi - fi -done - -# Check for trailing whitespace -for file in metadata.lua hooks/*.lua scripts/*.sh README.md; do - if [ -f "$file" ]; then - echo -n " Checking trailing whitespace in $(basename "$file")... " - if ! grep -q '[[:space:]]$' "$file"; then - echo -e "${GREEN}✓${NC}" - else - echo -e "${RED}✗${NC}" - LINT_PASSED=false - fi - fi -done - -# Summary -echo -if [ "$LINT_PASSED" = true ]; then - info "All linting checks passed!" - exit 0 -else - error "Some linting checks failed" - exit 1 -fi diff --git a/scripts/test.sh b/scripts/test.sh deleted file mode 100755 index d0c7bf5..0000000 --- a/scripts/test.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Colors for output -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -NC='\033[0m' # No Color - -# Test counter -TESTS_PASSED=0 -TESTS_FAILED=0 - -# Helper functions -info() { - echo -e "${GREEN}[INFO]${NC} $1" -} - -error() { - echo -e "${RED}[ERROR]${NC} $1" -} - -warning() { - echo -e "${YELLOW}[WARNING]${NC} $1" -} - -run_test() { - local test_name="$1" - local test_cmd="$2" - - echo -n "Testing $test_name... " - if eval "$test_cmd" >/dev/null 2>&1; then - echo -e "${GREEN}✓${NC}" - TESTS_PASSED=$((TESTS_PASSED + 1)) - else - echo -e "${RED}✗${NC}" - TESTS_FAILED=$((TESTS_FAILED + 1)) - fi -} - -# Setup test environment -TEST_DIR=$(mktemp -d) -trap 'rm -rf $TEST_DIR' EXIT - -info "Starting mise-semver plugin tests" - -# Test 1: Check plugin structure -run_test "Plugin structure" "test -f metadata.lua && test -d hooks" - -# Test 2: Check required hooks exist -run_test "Available hook exists" "test -f hooks/available.lua" -run_test "Pre-install hook exists" "test -f hooks/pre_install.lua" -run_test "Post-install hook exists" "test -f hooks/post_install.lua" -run_test "Env keys hook exists" "test -f hooks/env_keys.lua" - -# Test 3: Validate Lua syntax -if command -v luac >/dev/null 2>&1; then - run_test "metadata.lua syntax" "luac -p metadata.lua" - run_test "available.lua syntax" "luac -p hooks/available.lua" - run_test "pre_install.lua syntax" "luac -p hooks/pre_install.lua" - run_test "post_install.lua syntax" "luac -p hooks/post_install.lua" - run_test "env_keys.lua syntax" "luac -p hooks/env_keys.lua" -else - warning "luac not found, skipping Lua syntax checks" -fi - -# Test 4: Test with mise if available -if command -v mise >/dev/null 2>&1; then - info "Testing with mise" - - # Save current directory - PLUGIN_DIR=$(pwd) - - # Create test project - cd "$TEST_DIR" - - # Uninstall plugin if already installed - mise plugin uninstall semver 2>/dev/null || true - - # Install plugin from local directory - run_test "Plugin installation" "mise plugin link semver '$PLUGIN_DIR'" - - # List available versions - run_test "List versions" "mise ls-remote semver | grep -q '3.4.0'" - - # Install a specific version - run_test "Install semver 3.4.0" "mise install semver@3.4.0" - - # Test execution - run_test "Execute semver" "mise exec semver@3.4.0 -- semver --version | grep -q '3.4.0'" - - # Clean up - mise plugin uninstall semver 2>/dev/null || true - - cd "$PLUGIN_DIR" -else - warning "mise not found, skipping integration tests" -fi - -# Print summary -echo -echo "Test Results:" -echo "=============" -echo -e "Passed: ${GREEN}$TESTS_PASSED${NC}" -echo -e "Failed: ${RED}$TESTS_FAILED${NC}" - -if [ $TESTS_FAILED -eq 0 ]; then - info "All tests passed!" - exit 0 -else - error "Some tests failed" - exit 1 -fi From 1a4151738093de62df0c1dc307a0e3fd00528088 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:14:56 -0500 Subject: [PATCH 02/11] chore: simplify CI workflow further MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run `mise run ci` directly instead of separate lint/test jobs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/ci.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c89c0f..73040d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,14 +8,7 @@ on: workflow_dispatch: jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: jdx/mise-action@v2 - - run: mise run lint - - test: + ci: strategy: matrix: os: [ubuntu-latest, macos-latest] @@ -23,4 +16,4 @@ jobs: steps: - uses: actions/checkout@v4 - uses: jdx/mise-action@v2 - - run: mise run test \ No newline at end of file + - run: mise run ci \ No newline at end of file From 899d6b6950d98f4037148838a1ab6ee22f9bd987 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:18:34 -0500 Subject: [PATCH 03/11] feat: add luacheck and StyLua for better Lua linting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace basic Lua syntax check with luacheck - Add StyLua for consistent code formatting - Add configuration files for both tools - Format all Lua files with StyLua - Fix unused variable warnings from luacheck - Add format task to mise.toml 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .luacheckrc | 39 +++++++++++++++++++++++++++++++++++++++ hooks/available.lua | 6 +++--- hooks/env_keys.lua | 6 +++--- hooks/post_install.lua | 6 ++---- hooks/pre_install.lua | 4 ++-- metadata.lua | 4 ++-- mise.toml | 15 +++++++++------ stylua.toml | 10 ++++++++++ 8 files changed, 70 insertions(+), 20 deletions(-) create mode 100644 .luacheckrc create mode 100644 stylua.toml diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..0129608 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,39 @@ +-- .luacheckrc configuration for mise-semver plugin + +-- Globals defined by the vfox plugin system +globals = { + "PLUGIN" +} + +-- Read-only globals from vfox environment +read_globals = { + -- Standard Lua globals + "require", + "os", + "io", + "table", + "string", + "math", + "loadfile", + "error", + "ipairs", + "pairs", + "print", + "tostring", + "tonumber", + "type", + "getmetatable", + "setmetatable", + + -- vfox context object + "ctx" +} + +-- Ignore line length warnings +max_line_length = false + +-- Ignore unused arguments in hook functions +unused_args = false + +-- Allow trailing whitespace (can be auto-fixed) +allow_defined_top = true \ No newline at end of file diff --git a/hooks/available.lua b/hooks/available.lua index fc8689e..d6dbc36 100644 --- a/hooks/available.lua +++ b/hooks/available.lua @@ -17,7 +17,7 @@ function PLUGIN:Available(ctx) -- Make API request local resp, err = http.get({ url = repo_url, - headers = headers + headers = headers, }) if err ~= nil then @@ -39,9 +39,9 @@ function PLUGIN:Available(ctx) -- Add version to result table.insert(result, { version = version, - note = nil + note = nil, }) end return result -end \ No newline at end of file +end diff --git a/hooks/env_keys.lua b/hooks/env_keys.lua index 6e58f6e..b1b0fcc 100644 --- a/hooks/env_keys.lua +++ b/hooks/env_keys.lua @@ -6,7 +6,7 @@ function PLUGIN:EnvKeys(ctx) return { { key = "PATH", - value = mainPath .. "/bin" - } + value = mainPath .. "/bin", + }, } -end \ No newline at end of file +end diff --git a/hooks/post_install.lua b/hooks/post_install.lua index c2217a8..d0694e4 100644 --- a/hooks/post_install.lua +++ b/hooks/post_install.lua @@ -1,9 +1,7 @@ -- hooks/post_install.lua function PLUGIN:PostInstall(ctx) - local rootPath = ctx.rootPath - local sdkInfo = ctx.sdkInfo['semver'] + local sdkInfo = ctx.sdkInfo["semver"] local path = sdkInfo.path - local version = sdkInfo.version -- Create bin directory if it doesn't exist os.execute("mkdir -p " .. path .. "/bin") @@ -24,4 +22,4 @@ function PLUGIN:PostInstall(ctx) if testResult ~= 0 then error("semver installation appears to be broken") end -end \ No newline at end of file +end diff --git a/hooks/pre_install.lua b/hooks/pre_install.lua index 3721125..af72aa2 100644 --- a/hooks/pre_install.lua +++ b/hooks/pre_install.lua @@ -8,6 +8,6 @@ function PLUGIN:PreInstall(ctx) return { version = version, url = url, - note = "Downloading semver " .. version + note = "Downloading semver " .. version, } -end \ No newline at end of file +end diff --git a/metadata.lua b/metadata.lua index 499db3e..b9e4014 100644 --- a/metadata.lua +++ b/metadata.lua @@ -5,5 +5,5 @@ PLUGIN = { description = "A semantic versioning (semver) command-line tool", author = "mise-plugins", updateUrl = "https://github.com/mise-plugins/mise-semver", - minRuntimeVersion = "0.2.0" -} \ No newline at end of file + minRuntimeVersion = "0.2.0", +} diff --git a/mise.toml b/mise.toml index bc356c8..abbf4ec 100644 --- a/mise.toml +++ b/mise.toml @@ -1,7 +1,7 @@ [tools] semver = "3.4.0" -shellcheck = "latest" lua = "5.4" +"cargo:stylua" = "latest" [tasks.test] description = "Run plugin tests" @@ -14,14 +14,17 @@ run = """ """ [tasks.lint] -description = "Lint Lua scripts" +description = "Lint and format check Lua scripts" run = """ - for f in metadata.lua hooks/*.lua; do - lua -e "loadfile('$f')" 2>&1 | grep -q "syntax error" && echo "✗ $f has syntax errors" && exit 1 || true - done - echo "✓ Lint passed" + luarocks install luacheck --local 2>/dev/null || true + ~/.luarocks/bin/luacheck metadata.lua hooks/ + stylua --check metadata.lua hooks/ """ +[tasks.format] +description = "Format Lua scripts" +run = "stylua metadata.lua hooks/" + [tasks.ci] description = "Run all CI checks" depends = ["lint", "test"] \ No newline at end of file diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..5b1add7 --- /dev/null +++ b/stylua.toml @@ -0,0 +1,10 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 4 +quote_style = "AutoPreferDouble" +call_parentheses = "Always" +collapse_simple_statement = "Never" + +[sort_requires] +enabled = false \ No newline at end of file From 60c8e5185bee842e925e228331c30cf199d33e0e Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:20:10 -0500 Subject: [PATCH 04/11] chore: use direct stylua plugin instead of cargo:stylua MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simpler and faster to use the direct stylua plugin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index abbf4ec..3a50afb 100644 --- a/mise.toml +++ b/mise.toml @@ -1,7 +1,7 @@ [tools] semver = "3.4.0" lua = "5.4" -"cargo:stylua" = "latest" +stylua = "latest" [tasks.test] description = "Run plugin tests" From 6abf6147fd698eb7bca395ba426c56e915490719 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:22:33 -0500 Subject: [PATCH 05/11] fix: resolve CI test failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add semver installation step to test task - Remove semver from tools to avoid conflicts during testing - Set MISE_USE_VERSIONS=0 globally in mise.toml 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- mise.toml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mise.toml b/mise.toml index 3a50afb..ea175da 100644 --- a/mise.toml +++ b/mise.toml @@ -1,5 +1,7 @@ +[env] +MISE_USE_VERSIONS = "0" + [tools] -semver = "3.4.0" lua = "5.4" stylua = "latest" @@ -9,7 +11,8 @@ run = """ mise plugin uninstall semver 2>/dev/null || true mise plugin link semver . mise cache clear - MISE_USE_VERSIONS=0 mise exec semver -- semver --version | grep -q '3.4.0' + mise install semver@3.4.0 + mise exec semver@3.4.0 -- semver --version | grep -q '3.4.0' echo "✓ Tests passed" """ From 0733942df37c9fb8772ecdcede897b215f28bc74 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:22:51 -0500 Subject: [PATCH 06/11] fix: correct environment variable name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use MISE_USE_VERSIONS_HOST instead of MISE_USE_VERSIONS 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index ea175da..ab98d82 100644 --- a/mise.toml +++ b/mise.toml @@ -1,5 +1,5 @@ [env] -MISE_USE_VERSIONS = "0" +MISE_USE_VERSIONS_HOST = "0" [tools] lua = "5.4" From 75dc1405100f195fc40959726497f1a25d59d387 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:25:17 -0500 Subject: [PATCH 07/11] refactor: convert inline tasks to mise file tasks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move test logic to .mise/tasks/test - Move lint logic to .mise/tasks/lint - Simplify mise.toml by removing inline scripts - Tasks are now more maintainable as separate files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .mise/tasks/lint | 6 ++++++ .mise/tasks/test | 9 +++++++++ mise.toml | 19 ------------------- 3 files changed, 15 insertions(+), 19 deletions(-) create mode 100755 .mise/tasks/lint create mode 100755 .mise/tasks/test diff --git a/.mise/tasks/lint b/.mise/tasks/lint new file mode 100755 index 0000000..21851e6 --- /dev/null +++ b/.mise/tasks/lint @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail + +luarocks install luacheck --local 2>/dev/null || true +~/.luarocks/bin/luacheck metadata.lua hooks/ +stylua --check metadata.lua hooks/ \ No newline at end of file diff --git a/.mise/tasks/test b/.mise/tasks/test new file mode 100755 index 0000000..94b4da7 --- /dev/null +++ b/.mise/tasks/test @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euo pipefail + +mise plugin uninstall semver 2>/dev/null || true +mise plugin link semver . +mise cache clear +mise install semver@3.4.0 +mise exec semver@3.4.0 -- semver --version | grep -q '3.4.0' +echo "✓ Tests passed" \ No newline at end of file diff --git a/mise.toml b/mise.toml index ab98d82..e512ad3 100644 --- a/mise.toml +++ b/mise.toml @@ -5,25 +5,6 @@ MISE_USE_VERSIONS_HOST = "0" lua = "5.4" stylua = "latest" -[tasks.test] -description = "Run plugin tests" -run = """ - mise plugin uninstall semver 2>/dev/null || true - mise plugin link semver . - mise cache clear - mise install semver@3.4.0 - mise exec semver@3.4.0 -- semver --version | grep -q '3.4.0' - echo "✓ Tests passed" -""" - -[tasks.lint] -description = "Lint and format check Lua scripts" -run = """ - luarocks install luacheck --local 2>/dev/null || true - ~/.luarocks/bin/luacheck metadata.lua hooks/ - stylua --check metadata.lua hooks/ -""" - [tasks.format] description = "Format Lua scripts" run = "stylua metadata.lua hooks/" From 8aa4b4db5709212f9529e9f088f9aa2b5ee77403 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:26:11 -0500 Subject: [PATCH 08/11] refactor: simplify test task and improve lint output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use `mise plugin link --force` instead of uninstall/link - Remove stderr redirect from luarocks install for better debugging 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .mise/tasks/lint | 2 +- .mise/tasks/test | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.mise/tasks/lint b/.mise/tasks/lint index 21851e6..37d4f43 100755 --- a/.mise/tasks/lint +++ b/.mise/tasks/lint @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -luarocks install luacheck --local 2>/dev/null || true +luarocks install luacheck --local || true ~/.luarocks/bin/luacheck metadata.lua hooks/ stylua --check metadata.lua hooks/ \ No newline at end of file diff --git a/.mise/tasks/test b/.mise/tasks/test index 94b4da7..4be8d2c 100755 --- a/.mise/tasks/test +++ b/.mise/tasks/test @@ -1,8 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -mise plugin uninstall semver 2>/dev/null || true -mise plugin link semver . +mise plugin link --force semver . mise cache clear mise install semver@3.4.0 mise exec semver@3.4.0 -- semver --version | grep -q '3.4.0' From 7154f064daa8bc755bfeea1a19d53f8ec8131c20 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:28:02 -0500 Subject: [PATCH 09/11] refactor: use mise-tasks instead of .mise/tasks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More conventional directory name for mise task files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- {.mise/tasks => mise-tasks}/lint | 0 {.mise/tasks => mise-tasks}/test | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {.mise/tasks => mise-tasks}/lint (100%) rename {.mise/tasks => mise-tasks}/test (100%) diff --git a/.mise/tasks/lint b/mise-tasks/lint similarity index 100% rename from .mise/tasks/lint rename to mise-tasks/lint diff --git a/.mise/tasks/test b/mise-tasks/test similarity index 100% rename from .mise/tasks/test rename to mise-tasks/test From 6282f17e3927c184ab4d4bf1f0f6888c52ad8dfc Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:29:14 -0500 Subject: [PATCH 10/11] fix: show semver output in test while still verifying MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test now displays the actual semver output for visibility while still verifying the version is correct 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- mise-tasks/test | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mise-tasks/test b/mise-tasks/test index 4be8d2c..83687ae 100755 --- a/mise-tasks/test +++ b/mise-tasks/test @@ -4,5 +4,14 @@ set -euo pipefail mise plugin link --force semver . mise cache clear mise install semver@3.4.0 -mise exec semver@3.4.0 -- semver --version | grep -q '3.4.0' -echo "✓ Tests passed" \ No newline at end of file + +# Capture and display the output while also verifying it +output=$(mise exec semver@3.4.0 -- semver --version) +echo "semver output: $output" + +if echo "$output" | grep -q '3.4.0'; then + echo "✓ Tests passed" +else + echo "✗ Test failed: expected version 3.4.0" + exit 1 +fi \ No newline at end of file From fbce5da60f0be51469d04165bfcb3c227a904b39 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:30:17 -0500 Subject: [PATCH 11/11] docs: add mise task descriptions via special comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added #MISE description comments to file tasks for better documentation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- mise-tasks/lint | 1 + mise-tasks/test | 1 + 2 files changed, 2 insertions(+) diff --git a/mise-tasks/lint b/mise-tasks/lint index 37d4f43..f0a88bb 100755 --- a/mise-tasks/lint +++ b/mise-tasks/lint @@ -1,4 +1,5 @@ #!/usr/bin/env bash +#MISE description="Lint and format check Lua scripts with luacheck and StyLua" set -euo pipefail luarocks install luacheck --local || true diff --git a/mise-tasks/test b/mise-tasks/test index 83687ae..c327a13 100755 --- a/mise-tasks/test +++ b/mise-tasks/test @@ -1,4 +1,5 @@ #!/usr/bin/env bash +#MISE description="Run plugin tests - install and verify semver functionality" set -euo pipefail mise plugin link --force semver .