From b7774781d24a510995c2d5eed1a533ac559080ab Mon Sep 17 00:00:00 2001 From: Jonathan Apodaca Date: Tue, 26 Aug 2025 14:50:11 -0600 Subject: [PATCH] fix ci --- .github/workflows/ci.yaml | 8 ++++---- .woodpecker/ci.yaml | 10 ++++++++++ spec/range_spec.lua | 24 ++++++++++++------------ 3 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 .woodpecker/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c8e6c01..55d9ab4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,16 +14,16 @@ jobs: - name: Populate Nix store run: - nix-shell --run 'true' + nix-shell --pure --run 'true' - name: Type-check with lua-language-server run: - nix-shell --run 'make lint' + nix-shell --pure --run 'make lint' - name: Check formatting with stylua run: - nix-shell --run 'make fmt-check' + nix-shell --pure --run 'make fmt-check' - name: Run busted tests run: - nix-shell --run 'make test' + nix-shell --pure --run 'make test' diff --git a/.woodpecker/ci.yaml b/.woodpecker/ci.yaml new file mode 100644 index 0000000..8374cb6 --- /dev/null +++ b/.woodpecker/ci.yaml @@ -0,0 +1,10 @@ +when: + - event: push + +steps: + - name: build + image: nixos/nix + commands: + - nix-shell --pure --run 'make lint' + - nix-shell --pure --run 'make fmt-check' + - nix-shell --pure --run 'make test' diff --git a/spec/range_spec.lua b/spec/range_spec.lua index 7f47ed0..3c3079b 100644 --- a/spec/range_spec.lua +++ b/spec/range_spec.lua @@ -292,19 +292,19 @@ describe('Range', function() it('from_tsquery_caps with string array filter', function() withbuf({ '{', - ' "sample-key1": "sample-value1",', - ' "sample-key2": "sample-value2"', + ' sample_key1 = "sample-value1",', + ' sample_key2 = "sample-value2",', '}', }, function() - vim.cmd.setfiletype 'json' + vim.cmd.setfiletype 'lua' -- Place cursor in "sample-value1" Pos.new(0, 2, 25):save_to_pos '.' -- Query that captures both keys and values in pairs local query = [[ - (pair - key: _ @key + (field + name: _ @key value: _ @value) ]] @@ -321,24 +321,24 @@ describe('Range', function() assert.are.same(#ranges.value, 1) -- Check that we got sample-key1 and sample-value1 - assert.are.same(ranges.key[1]:text(), '"sample-key1"') + assert.are.same(ranges.key[1]:text(), 'sample_key1') assert.are.same(ranges.value[1]:text(), '"sample-value1"') end) -- Make sure this works when the match is on the last line: withbuf({ - '{"sample-key1": "sample-value1",', - '"sample-key2": "sample-value2"}', + '{sample_key1= "sample-value1",', + 'sample_key2= "sample-value2"}', }, function() - vim.cmd.setfiletype 'json' + vim.cmd.setfiletype 'lua' -- Place cursor in "sample-value1" Pos.new(0, 2, 25):save_to_pos '.' -- Query that captures both keys and values in pairs local query = [[ - (pair - key: _ @key + (field + name: _ @key value: _ @value) ]] @@ -355,7 +355,7 @@ describe('Range', function() assert.are.same(#ranges.value, 1) -- Check that we got sample-key2 and sample-value2 - assert.are.same(ranges.key[1]:text(), '"sample-key2"') + assert.are.same(ranges.key[1]:text(), 'sample_key2') assert.are.same(ranges.value[1]:text(), '"sample-value2"') end) end)