From cf7299610560b823d5d8a3b117abf8ee3ef1b006 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:18:00 +0800 Subject: [PATCH 001/100] feat(mvp): mvp --- giturlparser-scm-1.rockspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index a6ca4c3..db95bdd 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -13,5 +13,6 @@ dependencies = { } build = { type = "builtin", - modules = {} + modules = { + giturlparser = "src/giturlparser.lua", } From 3dbac19aee4c764ed006c0fc36093587305caad8 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:20:23 +0800 Subject: [PATCH 002/100] Update giturlparser-scm-1.rockspec --- giturlparser-scm-1.rockspec | 1 + 1 file changed, 1 insertion(+) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index db95bdd..ade07a3 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -16,3 +16,4 @@ build = { modules = { giturlparser = "src/giturlparser.lua", } +copy_directories = { "spec" } From 4327e31d33e1f4c4a9fb22f832c05c3880afd1a2 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:30:48 +0800 Subject: [PATCH 003/100] Create ci.yml --- .github/workflows/ci.yml | 128 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8c9fee9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,128 @@ +name: CI +on: + pull_request: + branches: + - main + push: + branches: + - main +concurrency: + group: ${{ github.ref }}-ci + cancel-in-progress: true +jobs: + pr_conventional_commit: + name: PR Conventional Commit + if: ${{ github.ref != 'refs/heads/main' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ytanikin/PRConventionalCommits@1.1.0 + with: + task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert","break"]' + luacheck: + name: Lua Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install commons.nvim + if: ${{ github.ref != 'refs/heads/main' }} + shell: bash + run: | + git clone --depth=1 https://github.com/linrongbin16/commons.nvim.git ~/.commons.nvim + rm -rf ./lua/fzfx/commons + mkdir -p ./lua/fzfx/commons + cp -rf ~/.commons.nvim/lua/commons/*.lua ./lua/fzfx/commons + cp ~/.commons.nvim/version.txt ./lua/fzfx/commons/version.txt + cd ./lua/fzfx/commons + find . -type f -name '*.lua' -exec sed -i 's/require("commons/require("fzfx.commons/g' {} \; + - uses: JohnnyMorganz/stylua-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --config-path .stylua.toml ./lua ./test ./bin + - uses: lunarmodules/luacheck@v1 + with: + args: lua --config .luacheckrc + - uses: stevearc/nvim-typecheck-action@v1 + with: + path: lua + level: Information + configpath: ".luarc.json" + neodev-version: stable + - uses: stefanzweifel/git-auto-commit-action@v4 + if: ${{ github.ref != 'refs/heads/main' }} + with: + commit_message: "chore(pr): auto-commit" + push_options: "--force" + unit_test: + name: Unit Test + needs: + - luacheck + strategy: + matrix: + nvim_version: [stable, nightly, v0.7.0] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: rhysd/action-setup-vim@v1 + id: vim + with: + neovim: true + version: ${{ matrix.nvim_version }} + - uses: leafo/gh-actions-lua@v10 + with: + luaVersion: "luajit-2.1.0-beta3" + - uses: leafo/gh-actions-luarocks@v4 + - name: Run test cases + shell: bash + run: | + luarocks install luacheck + luarocks install luacov + luarocks install cluacov + luarocks install vusted + git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf + ~/.fzf/install + export PATH="$HOME/.fzf/bin:$PATH" + vusted --coverage --shuffle ./test + - name: Generate coverage reports + shell: bash + run: | + echo "ls ." + ls -l . + echo "run luacov" + luacov + echo "ls ." + ls -l . + echo "cat ./luacov.report.out" + cat ./luacov.report.out + - uses: codecov/codecov-action@v3 + with: + files: luacov.report.out + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + release: + name: Release + if: ${{ github.ref == 'refs/heads/main' }} + needs: + - unit_test + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: simple + package-name: fzfx.nvim + - uses: actions/checkout@v4 + - uses: rickstaa/action-create-tag@v1 + if: ${{ steps.release.outputs.release_created }} + with: + tag: stable + message: "Current stable release: ${{ steps.release.outputs.tag_name }}" + tag_exists_error: false + force_push_tag: true + - uses: nvim-neorocks/luarocks-tag-release@v5 + if: ${{ steps.release.outputs.release_created }} + env: + LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} + with: + version: ${{ steps.release.outputs.tag_name }} From 0c9a346c60d9b04e43c8bc05f65d739ce0d4730b Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:39:06 +0800 Subject: [PATCH 004/100] Update ci.yml --- .github/workflows/ci.yml | 44 ++++++++++------------------------------ 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c9fee9..eb876a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,38 +17,24 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ytanikin/PRConventionalCommits@1.1.0 - with: - task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert","break"]' luacheck: name: Lua Check runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install commons.nvim - if: ${{ github.ref != 'refs/heads/main' }} - shell: bash - run: | - git clone --depth=1 https://github.com/linrongbin16/commons.nvim.git ~/.commons.nvim - rm -rf ./lua/fzfx/commons - mkdir -p ./lua/fzfx/commons - cp -rf ~/.commons.nvim/lua/commons/*.lua ./lua/fzfx/commons - cp ~/.commons.nvim/version.txt ./lua/fzfx/commons/version.txt - cd ./lua/fzfx/commons - find . -type f -name '*.lua' -exec sed -i 's/require("commons/require("fzfx.commons/g' {} \; - uses: JohnnyMorganz/stylua-action@v3 with: token: ${{ secrets.GITHUB_TOKEN }} version: latest - args: --config-path .stylua.toml ./lua ./test ./bin + args: --config-path .stylua.toml ./src ./spec - uses: lunarmodules/luacheck@v1 with: - args: lua --config .luacheckrc + args: src --config .luacheckrc - uses: stevearc/nvim-typecheck-action@v1 with: - path: lua + path: src level: Information configpath: ".luarc.json" - neodev-version: stable - uses: stefanzweifel/git-auto-commit-action@v4 if: ${{ github.ref != 'refs/heads/main' }} with: @@ -56,35 +42,27 @@ jobs: push_options: "--force" unit_test: name: Unit Test - needs: - - luacheck strategy: matrix: - nvim_version: [stable, nightly, v0.7.0] + lua_version: [5.1,5.2,5.3,5.4,luajit] + needs: + - luacheck runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: rhysd/action-setup-vim@v1 - id: vim - with: - neovim: true - version: ${{ matrix.nvim_version }} - uses: leafo/gh-actions-lua@v10 with: - luaVersion: "luajit-2.1.0-beta3" + luaVersion: ${{ matrix.lua_version }} - uses: leafo/gh-actions-luarocks@v4 - - name: Run test cases + - name: Run Tests shell: bash run: | luarocks install luacheck luarocks install luacov luarocks install cluacov - luarocks install vusted - git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf - ~/.fzf/install - export PATH="$HOME/.fzf/bin:$PATH" + luarocks install buested vusted --coverage --shuffle ./test - - name: Generate coverage reports + - name: Generate Coverage Reports shell: bash run: | echo "ls ." @@ -111,7 +89,7 @@ jobs: id: release with: release-type: simple - package-name: fzfx.nvim + package-name: giturlparser - uses: actions/checkout@v4 - uses: rickstaa/action-create-tag@v1 if: ${{ steps.release.outputs.release_created }} From f9496e93f85b11271724f355941140f69c927fa7 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:40:32 +0800 Subject: [PATCH 005/100] Create .luacheckrc --- .luacheckrc | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .luacheckrc diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..56f2305 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,5 @@ +globals = { "describe", "before_each", "it", "assert" } +max_line_length = 500 +unused = false +unused_args = false +exclude_files = {} From 11476f5a0ae12483cf4ded5da4ab19e154c183f1 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:41:06 +0800 Subject: [PATCH 006/100] Create .editorconfig --- .editorconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..61b78b1 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +root = true +end_of_line = lf +insert_final_newline = false +charset = utf-8 +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 + +[*.lua] +indent_size = 2 From 54e8fd5a33feeba2825cbf40283922558e62565f Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:41:44 +0800 Subject: [PATCH 007/100] Create .luacov --- .luacov | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .luacov diff --git a/.luacov b/.luacov new file mode 100644 index 0000000..7ad5b7f --- /dev/null +++ b/.luacov @@ -0,0 +1,8 @@ +modules = { + ["fzfx"] = "lua/fzfx.lua", + ["fzfx.*"] = "lua", + ["fzfx.*.*"] = "lua", +} +exclude = { + "lua/fzfx/commons/*.lua", +} From 6717c696037dbc8d9a05c3b2c0672708c92e8bcc Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:42:22 +0800 Subject: [PATCH 008/100] Update .luacov --- .luacov | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.luacov b/.luacov index 7ad5b7f..aa1f8ab 100644 --- a/.luacov +++ b/.luacov @@ -1,8 +1,4 @@ modules = { - ["fzfx"] = "lua/fzfx.lua", - ["fzfx.*"] = "lua", - ["fzfx.*.*"] = "lua", -} -exclude = { - "lua/fzfx/commons/*.lua", + ["giturlparser"] = "src/giturlparser.lua", } +exclude = {} From 3f874b1728c3657fd5d58783f956ea403c75c0e7 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:43:05 +0800 Subject: [PATCH 009/100] Create .luarc.json --- .luarc.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .luarc.json diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..16ee9d0 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,4 @@ +{ + "diagnostics.globals": ["describe", "before_each", "it", "jit"], + "workspace.checkThirdParty": "Disable" +} From a24cec9a2fba9cdfcc1d76bc6f8e1ddc1f58d28f Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:43:35 +0800 Subject: [PATCH 010/100] Create .stylua.toml --- .stylua.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .stylua.toml diff --git a/.stylua.toml b/.stylua.toml new file mode 100644 index 0000000..e272b1d --- /dev/null +++ b/.stylua.toml @@ -0,0 +1,4 @@ +column_width = 80 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 From c6af454c7ccb62e68fd80a1b041812511346ac9c Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:44:22 +0800 Subject: [PATCH 011/100] Create codecov.yml --- codecov.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..e938135 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + project: + default: + threshold: 90% + patch: + default: + threshold: 90% From f468e026a81421fa6c2d27069bd5b19c9647b00f Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:44:41 +0800 Subject: [PATCH 012/100] Create version.txt --- version.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 version.txt diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..3eefcb9 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.0.0 From 63558f054af2e2ff7143a97cc8dd32769dc16691 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:45:20 +0800 Subject: [PATCH 013/100] Create giturlparser.lua --- src/giturlparser.lua | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/giturlparser.lua diff --git a/src/giturlparser.lua b/src/giturlparser.lua new file mode 100644 index 0000000..1b3d9fd --- /dev/null +++ b/src/giturlparser.lua @@ -0,0 +1,3 @@ +local giturlparser = {} + +return giturlparser From a7ab26d608939dbd23d354158fd8f9f673af3b0d Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:45:43 +0800 Subject: [PATCH 014/100] Create giturlparser_spec.lua --- spec/giturlparser_spec.lua | 1 + 1 file changed, 1 insertion(+) create mode 100644 spec/giturlparser_spec.lua diff --git a/spec/giturlparser_spec.lua b/spec/giturlparser_spec.lua new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/spec/giturlparser_spec.lua @@ -0,0 +1 @@ + From 7319ef78342d873d214dbacd2dce3d638d5d4081 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 03:46:26 +0000 Subject: [PATCH 015/100] chore(pr): auto-commit --- spec/giturlparser_spec.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/giturlparser_spec.lua b/spec/giturlparser_spec.lua index 8b13789..e69de29 100644 --- a/spec/giturlparser_spec.lua +++ b/spec/giturlparser_spec.lua @@ -1 +0,0 @@ - From f0de3100e72d3d8116aa94f15648c1fe7446b76c Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:47:24 +0800 Subject: [PATCH 016/100] Update ci.yml --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb876a6..90e90b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ytanikin/PRConventionalCommits@1.1.0 + with: + task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert","break"]' luacheck: name: Lua Check runs-on: ubuntu-latest From f99f01315d0128a8556add92d48803835d59b6ce Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:54:11 +0800 Subject: [PATCH 017/100] Update giturlparser-scm-1.rockspec --- giturlparser-scm-1.rockspec | 1 - 1 file changed, 1 deletion(-) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index ade07a3..6c12cad 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -1,5 +1,4 @@ package = "giturlparser" -version = "0.0.1" source = { url = "https://github.com/linrongbin16/giturlparser.lua" } From 511bc241f5c942b13ca44780705c475938320513 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:57:17 +0800 Subject: [PATCH 018/100] Update ci.yml --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90e90b2..433cd3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,4 +105,12 @@ jobs: env: LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} with: + name: giturlparser + labels: | + 5.1 + 5.2 + 5.3 + 5.4 + luajit + template: giturlparser-scm-1.rockspec version: ${{ steps.release.outputs.tag_name }} From bfaeee4d35d594fba56ed31d91c6c340b85fff49 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 11:57:52 +0800 Subject: [PATCH 019/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 433cd3d..49aecf3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,7 +91,7 @@ jobs: id: release with: release-type: simple - package-name: giturlparser + package-name: giturlparser.lua - uses: actions/checkout@v4 - uses: rickstaa/action-create-tag@v1 if: ${{ steps.release.outputs.release_created }} From 55c18a54042f226851f8041c7e4c4a9f0bc102f0 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 12:01:39 +0800 Subject: [PATCH 020/100] Update giturlparser_spec.lua --- spec/giturlparser_spec.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/giturlparser_spec.lua b/spec/giturlparser_spec.lua index e69de29..f341a03 100644 --- a/spec/giturlparser_spec.lua +++ b/spec/giturlparser_spec.lua @@ -0,0 +1,15 @@ +describe("giturlparser", function() + local assert_eq = assert.is_equal + local assert_true = assert.is_true + local assert_false = assert.is_false + + before_each(function() + + end) + + local giturlparser = require("giturlparser") + describe("[]", function() + it("test", function() + end) + end) + end) From a36a022924e85aec951212aed3ad0012fc0d9e86 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 04:02:23 +0000 Subject: [PATCH 021/100] chore(pr): auto-commit --- spec/giturlparser_spec.lua | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/spec/giturlparser_spec.lua b/spec/giturlparser_spec.lua index f341a03..faba348 100644 --- a/spec/giturlparser_spec.lua +++ b/spec/giturlparser_spec.lua @@ -1,15 +1,12 @@ -describe("giturlparser", function() - local assert_eq = assert.is_equal - local assert_true = assert.is_true - local assert_false = assert.is_false - - before_each(function() - - end) - - local giturlparser = require("giturlparser") - describe("[]", function() - it("test", function() - end) - end) - end) +describe("giturlparser", function() + local assert_eq = assert.is_equal + local assert_true = assert.is_true + local assert_false = assert.is_false + + before_each(function() end) + + local giturlparser = require("giturlparser") + describe("[]", function() + it("test", function() end) + end) +end) From 6bb40e4c51855e9e82fa7b017e57dd7d16194392 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 12:11:07 +0800 Subject: [PATCH 022/100] Update giturlparser-scm-1.rockspec --- giturlparser-scm-1.rockspec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index 6c12cad..43bf453 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -7,9 +7,7 @@ description = { homepage = "https://github.com/linrongbin16/giturlparser.lua", license = "MIT" } -dependencies = { - "lua >= 5.1" -} +dependencies = {} build = { type = "builtin", modules = { From bbef46e4031dce2a7a55ef8368c3a89785c3a3bf Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 12:17:13 +0800 Subject: [PATCH 023/100] Update giturlparser-scm-1.rockspec --- giturlparser-scm-1.rockspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index 43bf453..47d547e 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -7,7 +7,8 @@ description = { homepage = "https://github.com/linrongbin16/giturlparser.lua", license = "MIT" } -dependencies = {} +dependencies = { +} build = { type = "builtin", modules = { From 5db4c132bcd1d7366ec4b1d96d46755f79ef131c Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 12:18:05 +0800 Subject: [PATCH 024/100] Update giturlparser-scm-1.rockspec --- giturlparser-scm-1.rockspec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index 47d547e..d7addad 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -9,6 +9,9 @@ description = { } dependencies = { } +test_dependencies = { + "busted", +} build = { type = "builtin", modules = { From ecb441531f6060faad249343a2ae05d5907d6e56 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 12:20:19 +0800 Subject: [PATCH 025/100] Update giturlparser-scm-1.rockspec --- giturlparser-scm-1.rockspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index d7addad..0e4d016 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -8,9 +8,10 @@ description = { license = "MIT" } dependencies = { + "lua >= 5.1", } test_dependencies = { - "busted", + "busted >= 2.1", } build = { type = "builtin", From 2ab13e54712820ee6e5693ed34dc6dbc105016f1 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 12:23:32 +0800 Subject: [PATCH 026/100] Update giturlparser-scm-1.rockspec --- giturlparser-scm-1.rockspec | 1 - 1 file changed, 1 deletion(-) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index 0e4d016..76214c0 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -8,7 +8,6 @@ description = { license = "MIT" } dependencies = { - "lua >= 5.1", } test_dependencies = { "busted >= 2.1", From 037259f8573680afb099f7a589c936f3d1c4f074 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 12:44:11 +0800 Subject: [PATCH 027/100] Update giturlparser-scm-1.rockspec --- giturlparser-scm-1.rockspec | 1 + 1 file changed, 1 insertion(+) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index 76214c0..0e4d016 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -8,6 +8,7 @@ description = { license = "MIT" } dependencies = { + "lua >= 5.1", } test_dependencies = { "busted >= 2.1", From 612dc5e8129f328986810243f434a50f18a86094 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 12:45:11 +0800 Subject: [PATCH 028/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49aecf3..460d638 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: luarocks install luacov luarocks install cluacov luarocks install buested - vusted --coverage --shuffle ./test + busted --coverage --shuffle ./test - name: Generate Coverage Reports shell: bash run: | From 7da75e40abdba355351f5363073fbfe318c598cf Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 12:45:35 +0800 Subject: [PATCH 029/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 460d638..14101ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true jobs: pr_conventional_commit: - name: PR Conventional Commit + name: Conventional Commit if: ${{ github.ref != 'refs/heads/main' }} runs-on: ubuntu-latest steps: From 5e09302f86091687dcf1d740e3376dec9713e02c Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 13:09:30 +0800 Subject: [PATCH 030/100] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4433869..0bc2581 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Pure Lua implemented git URL parsing library, e.g. the output of `git remote get ## Features -* [ ] Single lua file & zero dependencies. +* [ ] Single lua file & zero dependency. * [ ] Compatible with lua-5.1/luajit-2. * [ ] Compatible with RFC 3689. From e9841fe7097f29f4395d0a3c063ac887bbf4595d Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 13:09:43 +0800 Subject: [PATCH 031/100] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0bc2581..a74a889 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Pure Lua implemented git URL parsing library, e.g. the output of `git remote get ## Features -* [ ] Single lua file & zero dependency. +* [ ] Single file & zero dependency. * [ ] Compatible with lua-5.1/luajit-2. * [ ] Compatible with RFC 3689. From af38f744ac13e7877a38f542f6d5e2f575a6f53e Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 18:46:48 +0800 Subject: [PATCH 032/100] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a74a889..d514d3b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@ Pure Lua implemented git URL parsing library, e.g. the output of `git remote get ## Install -## API References +## API + +## References ## Development From 971320820c916a8a5b6ca718aad9d6aadb659438 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 18:47:42 +0800 Subject: [PATCH 033/100] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d514d3b..b700f04 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ Pure Lua implemented git URL parsing library, e.g. the output of `git remote get ## References +1. https://stackoverflow.com/questions/31801271/what-are-the-supported-git-url-formats +2. https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols + ## Development ## Contribute From 240c9c6d6d261292b42e8cbe00661309702a6fb6 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 18:49:32 +0800 Subject: [PATCH 034/100] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b700f04..d543383 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Pure Lua implemented git URL parsing library, e.g. the output of `git remote get ## References -1. https://stackoverflow.com/questions/31801271/what-are-the-supported-git-url-formats +1. [What are the supported git url formats?](https://stackoverflow.com/questions/31801271/what-are-the-supported-git-url-formats) 2. https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols ## Development From f41b8dc1a04272d085e6665b01bc537a8d00211a Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 18:50:15 +0800 Subject: [PATCH 035/100] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d543383..c844e46 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Pure Lua implemented git URL parsing library, e.g. the output of `git remote get ## References 1. [What are the supported git url formats?](https://stackoverflow.com/questions/31801271/what-are-the-supported-git-url-formats) -2. https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols +2. [4.1 Git on the Server - The Protocols](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols) ## Development From 2d63f248156685fccaa8c586099d4b031fa2a382 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 18:55:22 +0800 Subject: [PATCH 036/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14101ae..7f408ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: luarocks install luacov luarocks install cluacov luarocks install buested - busted --coverage --shuffle ./test + luarocks test --test-type buested --coverage --shuffle ./test - name: Generate Coverage Reports shell: bash run: | From 9840e39f0b1bca161236f5d8482d38b2709cae28 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 19:02:36 +0800 Subject: [PATCH 037/100] Update ci.yml --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f408ad..8b38d6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,8 @@ jobs: luarocks install luacov luarocks install cluacov luarocks install buested - luarocks test --test-type buested --coverage --shuffle ./test + luarocks install giturlparser-scm-1.rockspec + buested --coverage --shuffle ./test - name: Generate Coverage Reports shell: bash run: | From f2385aa4f5a4f0a1e6aa6e4581a300292309ac78 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 19:06:12 +0800 Subject: [PATCH 038/100] Update ci.yml --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b38d6a..1fa12f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,6 +64,8 @@ jobs: luarocks install cluacov luarocks install buested luarocks install giturlparser-scm-1.rockspec + echo 'luarocks config --lua-ver' + luarocks config --lua-ver buested --coverage --shuffle ./test - name: Generate Coverage Reports shell: bash From fd4fa829e455f4e1416c306517b21432c41e9d66 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 19:09:21 +0800 Subject: [PATCH 039/100] Update ci.ymlp --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fa12f1..4b5875d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,6 +66,8 @@ jobs: luarocks install giturlparser-scm-1.rockspec echo 'luarocks config --lua-ver' luarocks config --lua-ver + echo 'luarocks --check-lua-versions' + luarocks --check-lua-versions buested --coverage --shuffle ./test - name: Generate Coverage Reports shell: bash From 4cbfe984dea43d8325b6359c092c4713cfad53da Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 19:14:45 +0800 Subject: [PATCH 040/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b5875d..6707bcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: luarocks config --lua-ver echo 'luarocks --check-lua-versions' luarocks --check-lua-versions - buested --coverage --shuffle ./test + # buested --coverage --shuffle ./test - name: Generate Coverage Reports shell: bash run: | From 02631a5e0b7e99344522a66b0a9804221e483124 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 19:19:19 +0800 Subject: [PATCH 041/100] Update giturlparser-scm-1.rockspec --- giturlparser-scm-1.rockspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index 0e4d016..511a7ff 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -8,7 +8,7 @@ description = { license = "MIT" } dependencies = { - "lua >= 5.1", + "lua >= 5.1, < 5.5" } test_dependencies = { "busted >= 2.1", From 4fb224dc8e1daf5abfc3988bae4498ed425da41a Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 19:21:16 +0800 Subject: [PATCH 042/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6707bcd..8be9e64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: name: Unit Test strategy: matrix: - lua_version: [5.1,5.2,5.3,5.4,luajit] + lua_version: [5.1,5.2,5.3,5.4] needs: - luacheck runs-on: ubuntu-latest From 70eb78cea944c59255cdfb819b403c8d6899453c Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 19:24:24 +0800 Subject: [PATCH 043/100] Update ci.yml --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8be9e64..b138dea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,9 @@ jobs: luarocks install luacov luarocks install cluacov luarocks install buested + luarocks pack giturlparser-scm-1.rockspec + echo 'ls-1' + ls -lha luarocks install giturlparser-scm-1.rockspec echo 'luarocks config --lua-ver' luarocks config --lua-ver From fb80b4bb9d1d5b609081e718cb1929ca0d3a8669 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 19:50:24 +0800 Subject: [PATCH 044/100] Update giturlparser-scm-1.rockspec --- giturlparser-scm-1.rockspec | 1 - 1 file changed, 1 deletion(-) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index 511a7ff..76214c0 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -8,7 +8,6 @@ description = { license = "MIT" } dependencies = { - "lua >= 5.1, < 5.5" } test_dependencies = { "busted >= 2.1", From 094edb0de6aa9ba04d146037a1b538babb191367 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 19:52:51 +0800 Subject: [PATCH 045/100] Update giturlparser-scm-1.rockspec --- giturlparser-scm-1.rockspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec index 76214c0..ede09ca 100644 --- a/giturlparser-scm-1.rockspec +++ b/giturlparser-scm-1.rockspec @@ -1,4 +1,5 @@ package = "giturlparser" +version="scm-1-1" source = { url = "https://github.com/linrongbin16/giturlparser.lua" } @@ -8,6 +9,7 @@ description = { license = "MIT" } dependencies = { + "lua >= 5.1, < 5.4", } test_dependencies = { "busted >= 2.1", From 46ed8374df347c5fdf964701bd273b832c482802 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 21:07:27 +0800 Subject: [PATCH 046/100] chore --- giturlparser-dev-1.rockspec | 20 ++++++++++++++++++++ giturlparser-scm-1.rockspec | 22 ---------------------- 2 files changed, 20 insertions(+), 22 deletions(-) create mode 100644 giturlparser-dev-1.rockspec delete mode 100644 giturlparser-scm-1.rockspec diff --git a/giturlparser-dev-1.rockspec b/giturlparser-dev-1.rockspec new file mode 100644 index 0000000..5183b90 --- /dev/null +++ b/giturlparser-dev-1.rockspec @@ -0,0 +1,20 @@ +package = "giturlparser" +version = "dev-1" +source = { + url = "git+https://github.com/linrongbin16/giturlparser.lua.git", +} +description = { + summary = "Pure Lua implemented git URL parsing library.", + detailed = "Pure Lua implemented git URL parsing library.", + homepage = "https://github.com/linrongbin16/giturlparser.lua", + license = "MIT", +} +dependencies = { + "lua >= 5.1, < 5.5", +} +build = { + type = "builtin", + modules = { + giturlparser = "src/giturlparser.lua", + }, +} diff --git a/giturlparser-scm-1.rockspec b/giturlparser-scm-1.rockspec deleted file mode 100644 index ede09ca..0000000 --- a/giturlparser-scm-1.rockspec +++ /dev/null @@ -1,22 +0,0 @@ -package = "giturlparser" -version="scm-1-1" -source = { - url = "https://github.com/linrongbin16/giturlparser.lua" -} -description = { - summary = "Git URL parsing library for Lua, e.g. the output of `git remote get-url origin`.", - homepage = "https://github.com/linrongbin16/giturlparser.lua", - license = "MIT" -} -dependencies = { - "lua >= 5.1, < 5.4", -} -test_dependencies = { - "busted >= 2.1", -} -build = { - type = "builtin", - modules = { - giturlparser = "src/giturlparser.lua", -} -copy_directories = { "spec" } From 440a5109a5d9fc205029fffbb621380a717bca84 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 21:10:05 +0800 Subject: [PATCH 047/100] chore --- .github/workflows/ci.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b138dea..ec60d8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,15 +63,10 @@ jobs: luarocks install luacov luarocks install cluacov luarocks install buested - luarocks pack giturlparser-scm-1.rockspec + luarocks pack giturlparser-dev-1.rockspec echo 'ls-1' ls -lha - luarocks install giturlparser-scm-1.rockspec - echo 'luarocks config --lua-ver' - luarocks config --lua-ver - echo 'luarocks --check-lua-versions' - luarocks --check-lua-versions - # buested --coverage --shuffle ./test + buested --coverage --shuffle - name: Generate Coverage Reports shell: bash run: | From 1ecadeb3ec0ca33de55b4d436eea015ef7de7b9c Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 21:10:24 +0800 Subject: [PATCH 048/100] chore --- .github/workflows/ci.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec60d8c..78650b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,17 +103,3 @@ jobs: message: "Current stable release: ${{ steps.release.outputs.tag_name }}" tag_exists_error: false force_push_tag: true - - uses: nvim-neorocks/luarocks-tag-release@v5 - if: ${{ steps.release.outputs.release_created }} - env: - LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} - with: - name: giturlparser - labels: | - 5.1 - 5.2 - 5.3 - 5.4 - luajit - template: giturlparser-scm-1.rockspec - version: ${{ steps.release.outputs.tag_name }} From 3b043710f5f3101f57bc92b4bf0e8b5e8d31ab96 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 21:13:29 +0800 Subject: [PATCH 049/100] chore --- src/giturlparser.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/giturlparser.lua b/src/giturlparser.lua index 1b3d9fd..e911ad6 100644 --- a/src/giturlparser.lua +++ b/src/giturlparser.lua @@ -1,3 +1,13 @@ local giturlparser = {} +--- @class giturlparser.GitUrlInfo +--- @field protocol string? +--- @field user string? +--- @field password string? +--- @field host string? +--- @field port string? +--- @field org string? +--- @field repo string? +--- @field path string? e.g. org/repo + return giturlparser From bbd156002ee351399098aa25e07a04852caa038a Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 21:19:41 +0800 Subject: [PATCH 050/100] chore --- .github/workflows/ci.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78650b2..cf38b7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,25 +44,20 @@ jobs: push_options: "--force" unit_test: name: Unit Test - strategy: - matrix: - lua_version: [5.1,5.2,5.3,5.4] needs: - luacheck runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: leafo/gh-actions-lua@v10 - with: - luaVersion: ${{ matrix.lua_version }} - - uses: leafo/gh-actions-luarocks@v4 - name: Run Tests shell: bash run: | - luarocks install luacheck - luarocks install luacov - luarocks install cluacov - luarocks install buested + sudo apt install lua5.1 + sudo apt install luarocks + luarocks install --local luacheck + luarocks install --local luacov + luarocks install --local cluacov + luarocks install --local buested luarocks pack giturlparser-dev-1.rockspec echo 'ls-1' ls -lha From 26b0848b02c4aa633a463d9e0dacfe635b8b8adf Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 21:20:10 +0800 Subject: [PATCH 051/100] chore --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf38b7b..bad6cd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,9 @@ jobs: push_options: "--force" unit_test: name: Unit Test + strategy: + matrix: + lua_version: [5.1,5.2,5.3,5.4] needs: - luacheck runs-on: ubuntu-latest @@ -52,7 +55,7 @@ jobs: - name: Run Tests shell: bash run: | - sudo apt install lua5.1 + sudo apt install lua${{ matrix.lua_version }} sudo apt install luarocks luarocks install --local luacheck luarocks install --local luacov From a50a0a9a602420db32244acb1d205742bbc50689 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 21:22:18 +0800 Subject: [PATCH 052/100] chore --- .github/workflows/ci.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bad6cd8..cd4a515 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,21 +46,23 @@ jobs: name: Unit Test strategy: matrix: - lua_version: [5.1,5.2,5.3,5.4] + lua_version: ["5.1","5.2","5.3","5.4","luajit"] needs: - luacheck runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: leafo/gh-actions-lua@v10 + with: + luaVersion: ${{ matrix.lua_version }} + - uses: leafo/gh-actions-luarocks@v4 - name: Run Tests shell: bash run: | - sudo apt install lua${{ matrix.lua_version }} - sudo apt install luarocks - luarocks install --local luacheck - luarocks install --local luacov - luarocks install --local cluacov - luarocks install --local buested + luarocks install luacheck + luarocks install luacov + luarocks install cluacov + luarocks install buested luarocks pack giturlparser-dev-1.rockspec echo 'ls-1' ls -lha From 0033b5e3d4f9b65e8ca78dcfc5803772167f5575 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 21:26:05 +0800 Subject: [PATCH 053/100] chore --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd4a515..ec9b7db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,8 @@ jobs: luarocks install luacov luarocks install cluacov luarocks install buested - luarocks pack giturlparser-dev-1.rockspec + luarocks install --deps-only giturlparser-dev-1.rockspec + luarocks make echo 'ls-1' ls -lha buested --coverage --shuffle From 419d63a770862ee3a4699838a2a59d24e9ce22ec Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 21:29:20 +0800 Subject: [PATCH 054/100] chore --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec9b7db..fc5c189 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,8 +63,6 @@ jobs: luarocks install luacov luarocks install cluacov luarocks install buested - luarocks install --deps-only giturlparser-dev-1.rockspec - luarocks make echo 'ls-1' ls -lha buested --coverage --shuffle From 3d840bdf852dd1b3457ac77e1fa550b4ff7f1bd9 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 21:42:18 +0800 Subject: [PATCH 055/100] chore --- .github/workflows/ci.yml | 18 +++++----- src/giturlparser.lua | 72 +++++++++++++++++++++++++++++++++++----- 2 files changed, 73 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc5c189..d6c8884 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,17 +52,19 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: leafo/gh-actions-lua@v10 - with: - luaVersion: ${{ matrix.lua_version }} - - uses: leafo/gh-actions-luarocks@v4 + # - uses: leafo/gh-actions-lua@v10 + # with: + # luaVersion: ${{ matrix.lua_version }} + # - uses: leafo/gh-actions-luarocks@v4 - name: Run Tests shell: bash run: | - luarocks install luacheck - luarocks install luacov - luarocks install cluacov - luarocks install buested + apt install lua5.1 + apt install luarocks + luarocks install --local luacheck + luarocks install --local luacov + luarocks install --local cluacov + luarocks install --local buested echo 'ls-1' ls -lha buested --coverage --shuffle diff --git a/src/giturlparser.lua b/src/giturlparser.lua index e911ad6..8656242 100644 --- a/src/giturlparser.lua +++ b/src/giturlparser.lua @@ -1,13 +1,67 @@ local giturlparser = {} ---- @class giturlparser.GitUrlInfo ---- @field protocol string? ---- @field user string? ---- @field password string? ---- @field host string? ---- @field port string? ---- @field org string? ---- @field repo string? ---- @field path string? e.g. org/repo +-- utils { + +--- @param s string +--- @param t string +--- @param start integer? by default start=1 +--- @return integer? +giturlparser._find = function(s, t, start) + assert(type(s) == "string") + assert(type(t) == "string") + + start = start or 1 + for i = start, #s do + local match = true + for j = 1, #t do + if i + j - 1 > #s then + match = false + break + end + local a = string.byte(s, i + j - 1) + local b = string.byte(t, j) + if a ~= b then + match = false + break + end + end + if match then + return i + end + end + return nil +end + +-- utils } + +-- 'path' is all payload after 'host', e.g. 'org/repo'. +-- +--- @alias giturlparser.GitUrlInfo {protocol:string?,user:string?,password:string?,host:string?,port:integer?,org:string?,repo:string,path:string} +local GitUrlInfo = {} + +--- @param url string +--- @return giturlparser.GitUrlInfo?, string? +giturlparser.parse = function(url) + if type(url) ~= "string" or string.len(url) == 0 then + return nil, "empty string" + end + + local protocol = nil + local user = nil + local password = nil + local host = nil + local port = nil + local org = nil + local repo = nil + local path = nil + + local protocol_delimiter_end_pos = giturlparser._find(url, "://") + if + type(protocol_delimiter_end_pos) == "number" + and protocol_delimiter_end_pos > 1 + then + protocol = string.sub(url, 1, protocol_delimiter_end_pos - 1) + end +end return giturlparser From 68e7452d8d55b5391e04255b3bd83b54923e5175 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 21:44:35 +0800 Subject: [PATCH 056/100] chore --- .github/workflows/ci.yml | 4 ++-- src/giturlparser.lua | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6c8884..6ee3d81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,8 +59,8 @@ jobs: - name: Run Tests shell: bash run: | - apt install lua5.1 - apt install luarocks + sudo apt-get -y install lua5.1 + sudo apt-get -y install luarocks luarocks install --local luacheck luarocks install --local luacov luarocks install --local cluacov diff --git a/src/giturlparser.lua b/src/giturlparser.lua index 8656242..044fad0 100644 --- a/src/giturlparser.lua +++ b/src/giturlparser.lua @@ -61,6 +61,9 @@ giturlparser.parse = function(url) and protocol_delimiter_end_pos > 1 then protocol = string.sub(url, 1, protocol_delimiter_end_pos - 1) + -- https, ssh, file, sftp, etc + else + -- protocol is ommited, it's either ssh or local file path end end From 474c5fd9979a03f17dedaebf73462c29004183f8 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 22:25:47 +0800 Subject: [PATCH 057/100] chore --- src/giturlparser.lua | 162 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 152 insertions(+), 10 deletions(-) diff --git a/src/giturlparser.lua b/src/giturlparser.lua index 044fad0..afaa2b1 100644 --- a/src/giturlparser.lua +++ b/src/giturlparser.lua @@ -1,4 +1,4 @@ -local giturlparser = {} +local M = {} -- utils { @@ -6,7 +6,7 @@ local giturlparser = {} --- @param t string --- @param start integer? by default start=1 --- @return integer? -giturlparser._find = function(s, t, start) +M._find = function(s, t, start) assert(type(s) == "string") assert(type(t) == "string") @@ -32,39 +32,181 @@ giturlparser._find = function(s, t, start) return nil end +--- @param s string +--- @param t string +--- @param rstart integer? by default rstart=#s +--- @return integer? +M._rfind = function(s, t, rstart) + assert(type(s) == "string") + assert(type(t) == "string") + + rstart = rstart or #s + for i = rstart, 1, -1 do + local match = true + for j = 1, #t do + if i + j - 1 > #s then + match = false + break + end + local a = string.byte(s, i + j - 1) + local b = string.byte(t, j) + if a ~= b then + match = false + break + end + end + if match then + return i + end + end + return nil +end + -- utils } -- 'path' is all payload after 'host', e.g. 'org/repo'. -- ---- @alias giturlparser.GitUrlInfo {protocol:string?,user:string?,password:string?,host:string?,port:integer?,org:string?,repo:string,path:string} +--- @alias giturlparser.GitUrlPos {start_pos:integer?,end_pos:integer?} +--- @alias giturlparser.GitUrlInfo {protocol:string?,protocol_pos:giturlparser.GitUrlPos?,user:string?,user_pos:giturlparser.GitUrlPos?,password:string?,password_pos:giturlparser.GitUrlPos?,host:string?,host_pos:giturlparser.GitUrlPos?,org:string?,org_pos:giturlparser.GitUrlPos?,repo:string,repo_pos:giturlparser.GitUrlPos,path:string,path_pos:giturlparser.GitUrlPos} local GitUrlInfo = {} +--- @param url string +--- @param start_pos integer +--- @param end_pos integer +--- @return string, giturlparser.GitUrlPos +M._make = function(url, start_pos, end_pos) + --- @type giturlparser.GitUrlPos + local pos = { + start_pos = start_pos, + end_pos = end_pos, + } + local component = string.sub(url, start_pos, end_pos) + return component, pos +end + --- @param url string --- @return giturlparser.GitUrlInfo?, string? -giturlparser.parse = function(url) +M.parse = function(url) if type(url) ~= "string" or string.len(url) == 0 then return nil, "empty string" end local protocol = nil + local protocol_pos = nil local user = nil + local user_pos = nil local password = nil + local password_pos = nil local host = nil - local port = nil + local host_pos = nil local org = nil + local org_pos = nil local repo = nil + local repo_pos = nil local path = nil + local path_pos = nil - local protocol_delimiter_end_pos = giturlparser._find(url, "://") + local protocol_delimiter_pos = M._find(url, "://") if - type(protocol_delimiter_end_pos) == "number" - and protocol_delimiter_end_pos > 1 + type(protocol_delimiter_pos) == "number" and protocol_delimiter_pos > 1 then - protocol = string.sub(url, 1, protocol_delimiter_end_pos - 1) + protocol = string.sub(url, 1, protocol_delimiter_pos - 1) -- https, ssh, file, sftp, etc + local first_colon_pos = M._find(url, ":", protocol_delimiter_pos + 3) + if + type(first_colon_pos) == "number" + and first_colon_pos > protocol_delimiter_pos + 3 + then + -- ssh host end pos, or ssh user end pos + local first_at_pos = M._find(url, "@", first_colon_pos + 1) + if + type(first_at_pos) == "number" and first_at_pos > first_colon_pos + 1 + then + -- ssh password end pos + local second_colon_pos = M._find(url, ":", first_at_pos + 1) + if + type(second_colon_pos) == "number" + and second_colon_pos > first_at_pos + 1 + then + -- host end with ':' + host, host_pos = M._make(url, first_at_pos + 1, second_colon_pos - 1) + password, password_pos = + M._make(url, first_colon_pos + 1, first_at_pos - 1) + user, user_pos = + M._make(url, protocol_delimiter_pos + 3, first_colon_pos - 1) + + local last_slash_pos = M._rfind(url, "/") + if + type(last_slash_pos) == "number" + and last_slash_pos > second_colon_pos + 1 + then + repo, repo_pos = M._make(url, last_slash_pos + 1, string.len(url)) + org, org_pos = + M._make(url, second_colon_pos + 1, last_slash_pos - 1) + path, path_pos = M._make(url, second_colon_pos + 1, string.len(url)) + else + repo, repo_pos = M._make(url, second_colon_pos + 1, string.len(url)) + path, path_pos = M._make(url, second_colon_pos + 1, string.len(url)) + -- missing org, org_pos + end + else + local first_slash_pos = M._find(url, "/", first_at_pos + 1) + if + type(first_slash_pos) == "number" + and first_slash_pos > first_at_pos + 1 + then + -- host end with '/' + host, host_pos = M._make(url, first_at_pos + 1, first_slash_pos - 1) + password, password_pos = + M._make(url, first_colon_pos + 1, first_at_pos - 1) + user, user_pos = + M._make(url, protocol_delimiter_pos + 3, first_colon_pos - 1) + + local last_slash_pos = M._rfind(url, "/") + if + type(last_slash_pos) == "number" + and last_slash_pos > first_slash_pos + 1 + then + repo, repo_pos = M._make(url, last_slash_pos + 1, string.len(url)) + org, org_pos = + M._make(url, first_slash_pos + 1, last_slash_pos - 1) + path, path_pos = + M._make(url, first_slash_pos + 1, string.len(url)) + else + repo, repo_pos = + M._make(url, first_slash_pos + 1, string.len(url)) + path, path_pos = + M._make(url, first_slash_pos + 1, string.len(url)) + -- missing org, org_pos + end + else + end + end + else + -- host end with ':' + host, host_pos = + M._make(url, protocol_delimiter_pos + 3, first_colon_pos - 1) + -- missing user, password + + local last_slash_pos = M._rfind(url, "/") + if + type(last_slash_pos) == "number" + and last_slash_pos > first_colon_pos + 1 + then + repo, repo_pos = M._make(url, last_slash_pos + 1, string.len(url)) + org, org_pos = M._make(url, first_colon_pos + 1, last_slash_pos - 1) + path, path_pos = M._make(url, first_colon_pos + 1, string.len(url)) + else + repo, repo_pos = M._make(url, first_colon_pos + 1, string.len(url)) + path, path_pos = M._make(url, first_colon_pos + 1, string.len(url)) + -- missing org, org_pos + end + end + else + end else -- protocol is ommited, it's either ssh or local file path end end -return giturlparser +return M From aef5e928d3ed25ba32ac472343b9b971e329f3bb Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 22:55:04 +0800 Subject: [PATCH 058/100] chore --- src/giturlparser.lua | 221 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 217 insertions(+), 4 deletions(-) diff --git a/src/giturlparser.lua b/src/giturlparser.lua index afaa2b1..676c2b3 100644 --- a/src/giturlparser.lua +++ b/src/giturlparser.lua @@ -110,14 +110,14 @@ M.parse = function(url) if type(protocol_delimiter_pos) == "number" and protocol_delimiter_pos > 1 then - protocol = string.sub(url, 1, protocol_delimiter_pos - 1) -- https, ssh, file, sftp, etc + protocol, protocol_pos = M._make(url, 1, protocol_delimiter_pos - 1) local first_colon_pos = M._find(url, ":", protocol_delimiter_pos + 3) if type(first_colon_pos) == "number" and first_colon_pos > protocol_delimiter_pos + 3 then - -- ssh host end pos, or ssh user end pos + -- host end with ':', or user end with ':' local first_at_pos = M._find(url, "@", first_colon_pos + 1) if type(first_at_pos) == "number" and first_at_pos > first_colon_pos + 1 @@ -179,7 +179,9 @@ M.parse = function(url) M._make(url, first_slash_pos + 1, string.len(url)) -- missing org, org_pos end - else + + -- else + -- invalid url end end else @@ -203,10 +205,221 @@ M.parse = function(url) end end else + local first_slash_pos = M._find(url, "/", protocol_delimiter_pos + 3) + if + type(first_slash_pos) == "number" + and first_slash_pos > protocol_delimiter_pos + 3 + then + -- host end with '/' + host, host_pos = + M._make(url, protocol_delimiter_pos + 3, first_slash_pos - 1) + local last_slash_pos = M._rfind(url, "/") + if + type(last_slash_pos) == "number" + and last_slash_pos > first_slash_pos + 1 + then + repo, repo_pos = M._make(url, last_slash_pos + 1, string.len(url)) + org, org_pos = M._make(url, first_slash_pos + 1, last_slash_pos - 1) + path, path_pos = M._make(url, first_slash_pos + 1, string.len(url)) + else + repo, repo_pos = M._make(url, first_slash_pos + 1, string.len(url)) + path, path_pos = M._make(url, first_slash_pos + 1, string.len(url)) + -- missing org + end + + -- else + -- invalid url + end end else - -- protocol is ommited, it's either ssh or local file path + -- missing protocol, either ssh/local file path + local first_at_pos = M._find(url, "@") + if type(first_at_pos) == "number" and first_at_pos > 1 then + local first_colon_pos = M._find(url, ":") + if + type(first_colon_pos) == "number" + and first_colon_pos > 1 + and first_colon_pos < first_at_pos + then + -- user end with ':', password end with '@' + user, user_pos = M._make(url, 1, first_colon_pos - 1) + password, password_pos = + M._make(url, first_colon_pos + 1, first_at_pos - 1) + + local second_colon_pos = M._find(url, ":", first_at_pos + 1) + if + type(second_colon_pos) == "number" + and second_colon_pos > first_at_pos + 1 + then + -- host end with ':' + host, host_pos = M._make(url, first_at_pos + 1, second_colon_pos - 1) + + local last_slash_pos = M._rfind(url, "/") + if + type(last_slash_pos) == "number" + and last_slash_pos > second_colon_pos + 1 + then + repo, repo_pos = M._make(url, last_slash_pos + 1, string.len(url)) + org, org_pos = + M._make(url, second_colon_pos + 1, last_slash_pos - 1) + path, path_pos = M._make(url, second_colon_pos + 1, string.len(url)) + else + repo, repo_pos = M._make(url, second_colon_pos + 1, string.len(url)) + path, path_pos = M._make(url, second_colon_pos + 1, string.len(url)) + -- missing org + end + else + local first_slash_pos = M._find(url, "/", first_at_pos + 1) + if + type(first_slash_pos) == "number" + and first_slash_pos > first_at_pos + 1 + then + -- host end with '/' + host, host_pos = M._make(url, first_at_pos + 1, first_slash_pos - 1) + + local last_slash_pos = M._rfind(url, "/") + if + type(last_slash_pos) == "number" + and last_slash_pos > first_slash_pos + 1 + then + repo, repo_pos = M._make(url, last_slash_pos + 1, string.len(url)) + org, org_pos = + M._make(url, first_slash_pos + 1, last_slash_pos - 1) + path, path_pos = + M._make(url, first_slash_pos + 1, string.len(url)) + else + repo, repo_pos = + M._make(url, first_slash_pos + 1, string.len(url)) + path, path_pos = + M._make(url, first_slash_pos + 1, string.len(url)) + -- missing org + end + + -- else + -- invalid url + end + end + else + -- user end with '@' + user, user_pos = M._make(url, 1, first_at_pos - 1) + -- missing password + + local second_colon_pos = M._find(url, ":", first_at_pos + 1) + if + type(second_colon_pos) == "number" + and second_colon_pos > first_at_pos + 1 + then + -- host end with ':' + host, host_pos = M._make(url, first_at_pos + 1, second_colon_pos - 1) + + local last_slash_pos = M._rfind(url, "/") + if + type(last_slash_pos) == "number" + and last_slash_pos > second_colon_pos + 1 + then + repo, repo_pos = M._make(url, last_slash_pos + 1, string.len(url)) + org, org_pos = + M._make(url, second_colon_pos + 1, last_slash_pos - 1) + path, path_pos = M._make(url, second_colon_pos + 1, string.len(url)) + else + repo, repo_pos = M._make(url, second_colon_pos + 1, string.len(url)) + path, path_pos = M._make(url, second_colon_pos + 1, string.len(url)) + -- missing org + end + else + local first_slash_pos = M._find(url, "/", first_at_pos + 1) + if + type(first_slash_pos) == "number" + and first_slash_pos > first_at_pos + 1 + then + -- host end with '/' + host, host_pos = M._make(url, first_at_pos + 1, first_slash_pos - 1) + + local last_slash_pos = M._rfind(url, "/") + if + type(last_slash_pos) == "number" + and last_slash_pos > first_slash_pos + 1 + then + repo, repo_pos = M._make(url, last_slash_pos + 1, string.len(url)) + org, org_pos = + M._make(url, first_slash_pos + 1, last_slash_pos - 1) + path, path_pos = + M._make(url, first_slash_pos + 1, string.len(url)) + else + repo, repo_pos = + M._make(url, first_slash_pos + 1, string.len(url)) + path, path_pos = + M._make(url, first_slash_pos + 1, string.len(url)) + -- missing org + end + + -- else + -- invalid url + end + end + end + else + local first_colon_pos = M._find(url, ":") + if type(first_colon_pos) == "number" and first_colon_pos > 1 then + -- host end with ':' + host, host_pos = M._make(url, 1, first_colon_pos - 1) + + local last_slash_pos = M._rfind(url, "/") + if + type(last_slash_pos) == "number" + and last_slash_pos > first_colon_pos + 1 + then + repo, repo_pos = M._make(url, last_slash_pos + 1, string.len(url)) + org, org_pos = M._make(url, first_colon_pos + 1, last_slash_pos - 1) + path, path_pos = M._make(url, first_colon_pos + 1, string.len(url)) + else + repo, repo_pos = M._make(url, first_colon_pos + 1, string.len(url)) + path, path_pos = M._make(url, first_colon_pos + 1, string.len(url)) + -- missing org + end + else + local first_slash_pos = M._find(url, "/") + if type(first_slash_pos) == "number" and first_slash_pos > 1 then + -- host end with '/' + host, host_pos = M._make(url, 1, first_slash_pos - 1) + + local last_slash_pos = M._rfind(url, "/") + if + type(last_slash_pos) == "number" + and last_slash_pos > first_colon_pos + 1 + then + repo, repo_pos = M._make(url, last_slash_pos + 1, string.len(url)) + org, org_pos = M._make(url, first_colon_pos + 1, last_slash_pos - 1) + path, path_pos = M._make(url, first_colon_pos + 1, string.len(url)) + else + repo, repo_pos = M._make(url, first_colon_pos + 1, string.len(url)) + path, path_pos = M._make(url, first_colon_pos + 1, string.len(url)) + -- missing org + end + + -- else + -- invalid url + end + end + end end + + return { + protocol = protocol, + protocol_pos = protocol_pos, + user = user, + user_pos = user_pos, + password = password, + password_pos = password_pos, + host = host, + host_pos = host_pos, + org = org, + org_pos = org_pos, + repo = repo, + repo_pos = repo_pos, + path = path, + path_pos = path_pos, + } end return M From e149408536f1dd9c043ef6be0e4fcc90a43b4d9d Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 23:00:20 +0800 Subject: [PATCH 059/100] chore --- spec/giturlparser_spec.lua | 17 +++++++++++++-- src/giturlparser.lua | 43 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/spec/giturlparser_spec.lua b/spec/giturlparser_spec.lua index faba348..9cdfe21 100644 --- a/spec/giturlparser_spec.lua +++ b/spec/giturlparser_spec.lua @@ -6,7 +6,20 @@ describe("giturlparser", function() before_each(function() end) local giturlparser = require("giturlparser") - describe("[]", function() - it("test", function() end) + describe("[http(s)]", function() + it("http://host.xz/path/to/repo.git/", function() + local actual = giturlparser.parse("http://host.xz/path/to/repo.git/") + assert_eq(type(actual), "table") + assert_eq(actual.protocol, "http") + assert_eq(actual.protocol_pos.start_pos, 1) + assert_eq(actual.protocol_pos.end_pos, 4) + end) + it("https://host.xz/path/to/repo.git/", function() + local actual = giturlparser.parse("https://host.xz/path/to/repo.git/") + assert_eq(type(actual), "table") + assert_eq(actual.protocol, "https") + assert_eq(actual.protocol_pos.start_pos, 1) + assert_eq(actual.protocol_pos.end_pos, 5) + end) end) end) diff --git a/src/giturlparser.lua b/src/giturlparser.lua index 676c2b3..d83671a 100644 --- a/src/giturlparser.lua +++ b/src/giturlparser.lua @@ -2,6 +2,45 @@ local M = {} -- utils { +--- @param s string +--- @param t string +--- @param opts {ignorecase:boolean?}? +--- @return boolean +M._startswith = function(s, t, opts) + assert(type(s) == "string") + assert(type(t) == "string") + + opts = opts or { ignorecase = false } + opts.ignorecase = type(opts.ignorecase) == "boolean" and opts.ignorecase + or false + + if opts.ignorecase then + return string.len(s) >= string.len(t) and s:sub(1, #t):lower() == t:lower() + else + return string.len(s) >= string.len(t) and s:sub(1, #t) == t + end +end + +--- @param s string +--- @param t string +--- @param opts {ignorecase:boolean?}? +--- @return boolean +M._endswith = function(s, t, opts) + assert(type(s) == "string") + assert(type(t) == "string") + + opts = opts or { ignorecase = false } + opts.ignorecase = type(opts.ignorecase) == "boolean" and opts.ignorecase + or false + + if opts.ignorecase then + return string.len(s) >= string.len(t) + and s:sub(#s - #t + 1):lower() == t:lower() + else + return string.len(s) >= string.len(t) and s:sub(#s - #t + 1) == t + end +end + --- @param s string --- @param t string --- @param start integer? by default start=1 @@ -91,6 +130,10 @@ M.parse = function(url) return nil, "empty string" end + if M._endswith(url, "/") then + url = string.sub(url, 1, #url - 1) + end + local protocol = nil local protocol_pos = nil local user = nil From e067e5c3c73d42af7910806e9ab29f9426a4b753 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 23:02:26 +0800 Subject: [PATCH 060/100] chore --- spec/giturlparser_spec.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/giturlparser_spec.lua b/spec/giturlparser_spec.lua index 9cdfe21..5e39d7f 100644 --- a/spec/giturlparser_spec.lua +++ b/spec/giturlparser_spec.lua @@ -13,6 +13,16 @@ describe("giturlparser", function() assert_eq(actual.protocol, "http") assert_eq(actual.protocol_pos.start_pos, 1) assert_eq(actual.protocol_pos.end_pos, 4) + assert_eq(actual.user, nil) + assert_eq(actual.user_pos, nil) + assert_eq(actual.password, nil) + assert_eq(actual.password_pos, nil) + assert_eq(actual.host, "host.xz") + assert_eq(actual.host_pos.start_pos, 8) + assert_eq(actual.host_pos.end_pos, 14) + assert_eq(actual.org, "path/to") + assert_eq(actual.org_pos.start_pos, 16) + assert_eq(actual.org_pos.end_pos, 22) end) it("https://host.xz/path/to/repo.git/", function() local actual = giturlparser.parse("https://host.xz/path/to/repo.git/") From 5e446c33964d482ce3bd352dbbf5e495e7f3c155 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 23:04:57 +0800 Subject: [PATCH 061/100] chore --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ee3d81..c0961d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,8 @@ jobs: - name: Run Tests shell: bash run: | + echo 'pwd' + echo $PWD sudo apt-get -y install lua5.1 sudo apt-get -y install luarocks luarocks install --local luacheck From 839d36b43d58c04745c432170d97ad66a2e133c1 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 23:07:07 +0800 Subject: [PATCH 062/100] chore --- spec/giturlparser_spec.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/spec/giturlparser_spec.lua b/spec/giturlparser_spec.lua index 5e39d7f..0b943c2 100644 --- a/spec/giturlparser_spec.lua +++ b/spec/giturlparser_spec.lua @@ -23,6 +23,29 @@ describe("giturlparser", function() assert_eq(actual.org, "path/to") assert_eq(actual.org_pos.start_pos, 16) assert_eq(actual.org_pos.end_pos, 22) + assert_eq(actual.repo, "repo.git") + assert_eq(actual.repo_pos.start_pos, 24) + assert_eq(actual.repo_pos.end_pos, 31) + end) + it("http://host.xz/path/to/repo.git", function() + local actual = giturlparser.parse("http://host.xz/path/to/repo.git") + assert_eq(type(actual), "table") + assert_eq(actual.protocol, "http") + assert_eq(actual.protocol_pos.start_pos, 1) + assert_eq(actual.protocol_pos.end_pos, 4) + assert_eq(actual.user, nil) + assert_eq(actual.user_pos, nil) + assert_eq(actual.password, nil) + assert_eq(actual.password_pos, nil) + assert_eq(actual.host, "host.xz") + assert_eq(actual.host_pos.start_pos, 8) + assert_eq(actual.host_pos.end_pos, 14) + assert_eq(actual.org, "path/to") + assert_eq(actual.org_pos.start_pos, 16) + assert_eq(actual.org_pos.end_pos, 22) + assert_eq(actual.repo, "repo.git") + assert_eq(actual.repo_pos.start_pos, 24) + assert_eq(actual.repo_pos.end_pos, 31) end) it("https://host.xz/path/to/repo.git/", function() local actual = giturlparser.parse("https://host.xz/path/to/repo.git/") @@ -30,6 +53,19 @@ describe("giturlparser", function() assert_eq(actual.protocol, "https") assert_eq(actual.protocol_pos.start_pos, 1) assert_eq(actual.protocol_pos.end_pos, 5) + assert_eq(actual.user, nil) + assert_eq(actual.user_pos, nil) + assert_eq(actual.password, nil) + assert_eq(actual.password_pos, nil) + assert_eq(actual.host, "host.xz") + assert_eq(actual.host_pos.start_pos, 9) + assert_eq(actual.host_pos.end_pos, 15) + assert_eq(actual.org, "path/to") + assert_eq(actual.org_pos.start_pos, 17) + assert_eq(actual.org_pos.end_pos, 23) + assert_eq(actual.repo, "repo.git") + assert_eq(actual.repo_pos.start_pos, 25) + assert_eq(actual.repo_pos.end_pos, 32) end) end) end) From e49a2c7f63c7070c1cf35ab513025a939c804c40 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 23:07:17 +0800 Subject: [PATCH 063/100] chore --- spec/giturlparser_spec.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spec/giturlparser_spec.lua b/spec/giturlparser_spec.lua index 0b943c2..32bd9e0 100644 --- a/spec/giturlparser_spec.lua +++ b/spec/giturlparser_spec.lua @@ -67,5 +67,25 @@ describe("giturlparser", function() assert_eq(actual.repo_pos.start_pos, 25) assert_eq(actual.repo_pos.end_pos, 32) end) + it("https://host.xz/path/to/repo.git", function() + local actual = giturlparser.parse("https://host.xz/path/to/repo.git") + assert_eq(type(actual), "table") + assert_eq(actual.protocol, "https") + assert_eq(actual.protocol_pos.start_pos, 1) + assert_eq(actual.protocol_pos.end_pos, 5) + assert_eq(actual.user, nil) + assert_eq(actual.user_pos, nil) + assert_eq(actual.password, nil) + assert_eq(actual.password_pos, nil) + assert_eq(actual.host, "host.xz") + assert_eq(actual.host_pos.start_pos, 9) + assert_eq(actual.host_pos.end_pos, 15) + assert_eq(actual.org, "path/to") + assert_eq(actual.org_pos.start_pos, 17) + assert_eq(actual.org_pos.end_pos, 23) + assert_eq(actual.repo, "repo.git") + assert_eq(actual.repo_pos.start_pos, 25) + assert_eq(actual.repo_pos.end_pos, 32) + end) end) end) From 69a01ddeef73c0da3fad04ea8eed36b837e4fcb8 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 23:10:12 +0800 Subject: [PATCH 064/100] chore --- spec/giturlparser_spec.lua | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/spec/giturlparser_spec.lua b/spec/giturlparser_spec.lua index 32bd9e0..6d13cf0 100644 --- a/spec/giturlparser_spec.lua +++ b/spec/giturlparser_spec.lua @@ -87,5 +87,43 @@ describe("giturlparser", function() assert_eq(actual.repo_pos.start_pos, 25) assert_eq(actual.repo_pos.end_pos, 32) end) + it("https://git.samba.com/samba.git", function() + local actual = giturlparser.parse("https://git.samba.com/samba.git") + assert_eq(type(actual), "table") + assert_eq(actual.protocol, "https") + assert_eq(actual.protocol_pos.start_pos, 1) + assert_eq(actual.protocol_pos.end_pos, 5) + assert_eq(actual.user, nil) + assert_eq(actual.user_pos, nil) + assert_eq(actual.password, nil) + assert_eq(actual.password_pos, nil) + assert_eq(actual.host, "git.samba.com") + assert_eq(actual.host_pos.start_pos, 9) + assert_eq(actual.host_pos.end_pos, 21) + assert_eq(actual.org, nil) + assert_eq(actual.org_pos, nil) + assert_eq(actual.repo, "samba.git") + assert_eq(actual.repo_pos.start_pos, 23) + assert_eq(actual.repo_pos.end_pos, 31) + end) + it("https://git.samba.com/samba.git/", function() + local actual = giturlparser.parse("https://git.samba.com/samba.git/") + assert_eq(type(actual), "table") + assert_eq(actual.protocol, "https") + assert_eq(actual.protocol_pos.start_pos, 1) + assert_eq(actual.protocol_pos.end_pos, 5) + assert_eq(actual.user, nil) + assert_eq(actual.user_pos, nil) + assert_eq(actual.password, nil) + assert_eq(actual.password_pos, nil) + assert_eq(actual.host, "git.samba.com") + assert_eq(actual.host_pos.start_pos, 9) + assert_eq(actual.host_pos.end_pos, 21) + assert_eq(actual.org, nil) + assert_eq(actual.org_pos, nil) + assert_eq(actual.repo, "samba.git") + assert_eq(actual.repo_pos.start_pos, 23) + assert_eq(actual.repo_pos.end_pos, 31) + end) end) end) From 72ac7187962e00a5c477da73d7d6e1f4aad71ad5 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 23:11:22 +0800 Subject: [PATCH 065/100] chore --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0961d5..9388c63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,14 +61,14 @@ jobs: run: | echo 'pwd' echo $PWD + echo 'ls-1' + ls -lha sudo apt-get -y install lua5.1 sudo apt-get -y install luarocks luarocks install --local luacheck luarocks install --local luacov luarocks install --local cluacov luarocks install --local buested - echo 'ls-1' - ls -lha buested --coverage --shuffle - name: Generate Coverage Reports shell: bash From 97990578538d13e4ce7f5ff49a3ff96148af8108 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 23:14:50 +0800 Subject: [PATCH 066/100] chore --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9388c63..9cac3d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,10 +65,10 @@ jobs: ls -lha sudo apt-get -y install lua5.1 sudo apt-get -y install luarocks - luarocks install --local luacheck - luarocks install --local luacov - luarocks install --local cluacov - luarocks install --local buested + sudo luarocks install luacheck + sudo luarocks install luacov + sudo luarocks install cluacov + sudo luarocks install buested buested --coverage --shuffle - name: Generate Coverage Reports shell: bash From 72ad7944cc114f7cccede58eeab13f62623a6dc4 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 6 Jan 2024 23:19:58 +0800 Subject: [PATCH 067/100] chore --- spec/giturlparser_spec.lua | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/spec/giturlparser_spec.lua b/spec/giturlparser_spec.lua index 6d13cf0..3d49659 100644 --- a/spec/giturlparser_spec.lua +++ b/spec/giturlparser_spec.lua @@ -125,5 +125,48 @@ describe("giturlparser", function() assert_eq(actual.repo_pos.start_pos, 23) assert_eq(actual.repo_pos.end_pos, 31) end) + it("https://git.samba.org/bbaumbach/samba.git", function() + local actual = + giturlparser.parse("https://git.samba.org/bbaumbach/samba.git") + assert_eq(type(actual), "table") + assert_eq(actual.protocol, "https") + assert_eq(actual.protocol_pos.start_pos, 1) + assert_eq(actual.protocol_pos.end_pos, 5) + assert_eq(actual.user, nil) + assert_eq(actual.user_pos, nil) + assert_eq(actual.password, nil) + assert_eq(actual.password_pos, nil) + assert_eq(actual.host, "git.samba.org") + assert_eq(actual.host_pos.start_pos, 9) + assert_eq(actual.host_pos.end_pos, 21) + assert_eq(actual.org, "bbaumbach") + assert_eq(actual.org_pos.start_pos, 23) + assert_eq(actual.org_pos.end_pos, 31) + assert_eq(actual.repo, "samba.git") + assert_eq(actual.repo_pos.start_pos, 33) + assert_eq(actual.repo_pos.end_pos, 41) + end) + it("https://username:password@git.samba.com/samba.git", function() + local actual = + giturlparser.parse("https://username:password@git.samba.com/samba.git") + assert_eq(type(actual), "table") + assert_eq(actual.protocol, "https") + assert_eq(actual.protocol_pos.start_pos, 1) + assert_eq(actual.protocol_pos.end_pos, 5) + assert_eq(actual.user, "username") + assert_eq(actual.user_pos.start_pos, 9) + assert_eq(actual.user_pos.end_pos, 16) + assert_eq(actual.password, "password") + assert_eq(actual.password_pos.start_pos, 18) + assert_eq(actual.password_pos.end_pos, 25) + assert_eq(actual.host, "git.samba.com") + assert_eq(actual.host_pos.start_pos, 27) + assert_eq(actual.host_pos.end_pos, 39) + assert_eq(actual.org, nil) + assert_eq(actual.org_pos, nil) + assert_eq(actual.repo, "samba.git") + assert_eq(actual.repo_pos.start_pos, 41) + assert_eq(actual.repo_pos.end_pos, 49) + end) end) end) From e699b1c005876972d9c3738a60a4e787186ac474 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 06:14:56 +0800 Subject: [PATCH 068/100] Update giturlparser-dev-1.rockspec --- giturlparser-dev-1.rockspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/giturlparser-dev-1.rockspec b/giturlparser-dev-1.rockspec index 5183b90..c9ae216 100644 --- a/giturlparser-dev-1.rockspec +++ b/giturlparser-dev-1.rockspec @@ -10,7 +10,7 @@ description = { license = "MIT", } dependencies = { - "lua >= 5.1, < 5.5", + "lua >= 5.1, luajit >= 2.0.0", } build = { type = "builtin", From 435073d8e7d1cd4e6b04f8b3e21842b34b1b384e Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 06:27:13 +0800 Subject: [PATCH 069/100] Update ci.yml --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cac3d8..20f4f00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,8 @@ jobs: sudo luarocks install luacov sudo luarocks install cluacov sudo luarocks install buested - buested --coverage --shuffle + luarocks pack giturlparser-dev-1.rockspec + # buested --coverage --shuffle - name: Generate Coverage Reports shell: bash run: | From be2b667c2d06fcc0daff9a2e83c7ceab47659943 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 06:29:46 +0800 Subject: [PATCH 070/100] Update ci.yml --- .github/workflows/ci.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20f4f00..f279b69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,10 +52,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - # - uses: leafo/gh-actions-lua@v10 - # with: - # luaVersion: ${{ matrix.lua_version }} - # - uses: leafo/gh-actions-luarocks@v4 + - uses: leafo/gh-actions-lua@v10 + with: + luaVersion: ${{ matrix.lua_version }} + - uses: leafo/gh-actions-luarocks@v4 - name: Run Tests shell: bash run: | @@ -63,13 +63,10 @@ jobs: echo $PWD echo 'ls-1' ls -lha - sudo apt-get -y install lua5.1 - sudo apt-get -y install luarocks - sudo luarocks install luacheck sudo luarocks install luacov sudo luarocks install cluacov sudo luarocks install buested - luarocks pack giturlparser-dev-1.rockspec + luarocks --verbose pack giturlparser-dev-1.rockspec # buested --coverage --shuffle - name: Generate Coverage Reports shell: bash From 67193e9cd9dc88b5af6b3b8d47fd894312a5d171 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 06:32:57 +0800 Subject: [PATCH 071/100] Update giturlparser-dev-1.rockspec --- giturlparser-dev-1.rockspec | 1 + 1 file changed, 1 insertion(+) diff --git a/giturlparser-dev-1.rockspec b/giturlparser-dev-1.rockspec index c9ae216..0f7ec4b 100644 --- a/giturlparser-dev-1.rockspec +++ b/giturlparser-dev-1.rockspec @@ -17,4 +17,5 @@ build = { modules = { giturlparser = "src/giturlparser.lua", }, + copy_directories = { "test" } } From 4ed7b40d84dd7c60c5b67a6c27887b89f9c3ebce Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 06:33:12 +0800 Subject: [PATCH 072/100] Update giturlparser-dev-1.rockspec --- giturlparser-dev-1.rockspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/giturlparser-dev-1.rockspec b/giturlparser-dev-1.rockspec index 0f7ec4b..baeb31c 100644 --- a/giturlparser-dev-1.rockspec +++ b/giturlparser-dev-1.rockspec @@ -17,5 +17,5 @@ build = { modules = { giturlparser = "src/giturlparser.lua", }, - copy_directories = { "test" } + copy_directories = { "spec" } } From f396c7cd856dc5b9031bafc6442feac9f546c34d Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 06:38:35 +0800 Subject: [PATCH 073/100] Update ci.yml --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f279b69..cd1a907 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,9 +63,9 @@ jobs: echo $PWD echo 'ls-1' ls -lha - sudo luarocks install luacov - sudo luarocks install cluacov - sudo luarocks install buested + luarocks install luacov + luarocks install cluacov + luarocks install buested luarocks --verbose pack giturlparser-dev-1.rockspec # buested --coverage --shuffle - name: Generate Coverage Reports From b0a391697f2b42d79bce2659d8df9838cb5aa5d5 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 06:46:41 +0800 Subject: [PATCH 074/100] Update ci.yml --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd1a907..ad134db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,15 +46,18 @@ jobs: name: Unit Test strategy: matrix: - lua_version: ["5.1","5.2","5.3","5.4","luajit"] + lua_version: ["5.1.5","5.2.4","5.3.5","luajit-2.1.0-beta3"] needs: - luacheck runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true - uses: leafo/gh-actions-lua@v10 with: luaVersion: ${{ matrix.lua_version }} + - uses: xpol/setup-lua@v1 - uses: leafo/gh-actions-luarocks@v4 - name: Run Tests shell: bash From fd51994fa6380ffba4b97ce6201bb2c6ebc28ab7 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 06:47:57 +0800 Subject: [PATCH 075/100] Update ci.yml --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad134db..9e18647 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,10 +54,9 @@ jobs: - uses: actions/checkout@v4 - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true - - uses: leafo/gh-actions-lua@v10 - with: - luaVersion: ${{ matrix.lua_version }} - uses: xpol/setup-lua@v1 + with: + lua-version: ${{ matrix.lua_version }} - uses: leafo/gh-actions-luarocks@v4 - name: Run Tests shell: bash From 940727eead4dbad6acdfdc1bd011727994911fca Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 06:49:31 +0800 Subject: [PATCH 076/100] Update ci.yml --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e18647..d7a5bc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,8 +52,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - uses: xpol/setup-lua@v1 with: lua-version: ${{ matrix.lua_version }} From 411ca2946322cb0a36008662a8033a1eb6e4370b Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 06:52:47 +0800 Subject: [PATCH 077/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7a5bc8..c058ece 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - uses: actions/checkout@v4 - uses: xpol/setup-lua@v1 with: - lua-version: ${{ matrix.lua_version }} + lua-version: 5.1.5 - uses: leafo/gh-actions-luarocks@v4 - name: Run Tests shell: bash From d9b27b87e3f6764c3056836ec6ad1610b71b729f Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 06:55:13 +0800 Subject: [PATCH 078/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c058ece..d2a1664 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: xpol/setup-lua@v1 + - uses: xpol/setup-lua@v0.3 with: lua-version: 5.1.5 - uses: leafo/gh-actions-luarocks@v4 From 1b6c130dce5ebd32f1af0b0fae1b1a9671bcbc13 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:12:57 +0800 Subject: [PATCH 079/100] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2a1664..042df1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,9 +52,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: xpol/setup-lua@v0.3 + - uses: leafo/gh-actions-lua@v10 with: - lua-version: 5.1.5 + luaVersion: "5.1.5" - uses: leafo/gh-actions-luarocks@v4 - name: Run Tests shell: bash From 2f3eec7e68a8f58892544cb3bd1dbd28065612ee Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:15:55 +0800 Subject: [PATCH 080/100] Update giturlparser-dev-1.rockspec --- giturlparser-dev-1.rockspec | 1 - 1 file changed, 1 deletion(-) diff --git a/giturlparser-dev-1.rockspec b/giturlparser-dev-1.rockspec index baeb31c..cedf82c 100644 --- a/giturlparser-dev-1.rockspec +++ b/giturlparser-dev-1.rockspec @@ -10,7 +10,6 @@ description = { license = "MIT", } dependencies = { - "lua >= 5.1, luajit >= 2.0.0", } build = { type = "builtin", From f4326dc4d74497fa72407f9b07ccdb18e6fdfc26 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:17:05 +0800 Subject: [PATCH 081/100] Update giturlparser-dev-1.rockspec --- giturlparser-dev-1.rockspec | 1 - 1 file changed, 1 deletion(-) diff --git a/giturlparser-dev-1.rockspec b/giturlparser-dev-1.rockspec index cedf82c..6f06ce6 100644 --- a/giturlparser-dev-1.rockspec +++ b/giturlparser-dev-1.rockspec @@ -16,5 +16,4 @@ build = { modules = { giturlparser = "src/giturlparser.lua", }, - copy_directories = { "spec" } } From eba868566fd1772a72ea798794c775636976426a Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:17:29 +0800 Subject: [PATCH 082/100] Update giturlparser-dev-1.rockspec --- giturlparser-dev-1.rockspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/giturlparser-dev-1.rockspec b/giturlparser-dev-1.rockspec index 6f06ce6..febacdc 100644 --- a/giturlparser-dev-1.rockspec +++ b/giturlparser-dev-1.rockspec @@ -14,6 +14,6 @@ dependencies = { build = { type = "builtin", modules = { - giturlparser = "src/giturlparser.lua", + giturlparser = "giturlparser.lua", }, } From f93e60f754a2f555d7f844529ccb8469d49686ad Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:17:58 +0800 Subject: [PATCH 083/100] Rename src/giturlparser.lua to giturlparser.lua --- src/giturlparser.lua => giturlparser.lua | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/giturlparser.lua => giturlparser.lua (100%) diff --git a/src/giturlparser.lua b/giturlparser.lua similarity index 100% rename from src/giturlparser.lua rename to giturlparser.lua From 4f977d709eab7905c098ed5327b3d104fd301f76 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:18:57 +0800 Subject: [PATCH 084/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 042df1c..1d3f0e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} version: latest - args: --config-path .stylua.toml ./src ./spec + args: --config-path .stylua.toml ./ ./spec - uses: lunarmodules/luacheck@v1 with: args: src --config .luacheckrc From 1a898386cf316d20dc7c9e3fa29a842605d9065e Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:19:22 +0800 Subject: [PATCH 085/100] Update .luacov --- .luacov | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.luacov b/.luacov index aa1f8ab..bb502e6 100644 --- a/.luacov +++ b/.luacov @@ -1,4 +1,4 @@ modules = { - ["giturlparser"] = "src/giturlparser.lua", + ["giturlparser"] = "giturlparser.lua", } exclude = {} From d80b601b588c499b2c0baa17f77ad62acf15865f Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:21:01 +0800 Subject: [PATCH 086/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d3f0e8..bbb9732 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: args: --config-path .stylua.toml ./ ./spec - uses: lunarmodules/luacheck@v1 with: - args: src --config .luacheckrc + args: giturlparser.lua --config .luacheckrc - uses: stevearc/nvim-typecheck-action@v1 with: path: src From f1dc27246e73f42efb5d2a0ecf0b31ce73cb1d1b Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:23:48 +0800 Subject: [PATCH 087/100] Update ci.yml --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbb9732..765850c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,9 +44,9 @@ jobs: push_options: "--force" unit_test: name: Unit Test - strategy: - matrix: - lua_version: ["5.1.5","5.2.4","5.3.5","luajit-2.1.0-beta3"] + # strategy: + # matrix: + # lua_version: ["5.1.5","5.2.4","5.3.5","luajit-2.1.0-beta3"] needs: - luacheck runs-on: ubuntu-latest @@ -63,10 +63,10 @@ jobs: echo $PWD echo 'ls-1' ls -lha - luarocks install luacov - luarocks install cluacov - luarocks install buested - luarocks --verbose pack giturlparser-dev-1.rockspec + luarocks --lua-version=5.1.5 install luacov + luarocks --lua-version=5.1.5 install cluacov + luarocks --lua-version=5.1.5 install buested + luarocks --lua-version=5.1.5 --verbose pack giturlparser-dev-1.rockspec # buested --coverage --shuffle - name: Generate Coverage Reports shell: bash From 876ff38df91af0956e55466c199818bb0345caed Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:25:28 +0800 Subject: [PATCH 088/100] Update ci.yml --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 765850c..06a2111 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,10 +63,10 @@ jobs: echo $PWD echo 'ls-1' ls -lha - luarocks --lua-version=5.1.5 install luacov - luarocks --lua-version=5.1.5 install cluacov - luarocks --lua-version=5.1.5 install buested - luarocks --lua-version=5.1.5 --verbose pack giturlparser-dev-1.rockspec + luarocks --lua-version=5.1 install luacov + luarocks --lua-version=5.1 install cluacov + luarocks --lua-version=5.1 install buested + luarocks --lua-version=5.1 --verbose pack giturlparser-dev-1.rockspec # buested --coverage --shuffle - name: Generate Coverage Reports shell: bash From 78149c313cfc8ce6b52d0cfcfbe0bac8435118c9 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:26:22 +0800 Subject: [PATCH 089/100] Update ci.yml --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06a2111..4020299 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,6 +66,7 @@ jobs: luarocks --lua-version=5.1 install luacov luarocks --lua-version=5.1 install cluacov luarocks --lua-version=5.1 install buested + luarocks --lua-version=5.1 make luarocks --lua-version=5.1 --verbose pack giturlparser-dev-1.rockspec # buested --coverage --shuffle - name: Generate Coverage Reports From 968480fff8ea8c48c9776a508a74c351187a3c3f Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:27:20 +0800 Subject: [PATCH 090/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4020299..1d88e1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: args: giturlparser.lua --config .luacheckrc - uses: stevearc/nvim-typecheck-action@v1 with: - path: src + path: giturlparser.lua level: Information configpath: ".luarc.json" - uses: stefanzweifel/git-auto-commit-action@v4 From 5d980516373c9c0fde6a17b70b884680447dbf04 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:29:46 +0800 Subject: [PATCH 091/100] Update ci.yml --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d88e1c..3168292 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,9 +66,8 @@ jobs: luarocks --lua-version=5.1 install luacov luarocks --lua-version=5.1 install cluacov luarocks --lua-version=5.1 install buested - luarocks --lua-version=5.1 make - luarocks --lua-version=5.1 --verbose pack giturlparser-dev-1.rockspec - # buested --coverage --shuffle + luarocks --verbose --lua-version=5.1 make + buested - name: Generate Coverage Reports shell: bash run: | From 89d71cad6adc4ef2ad27878997a9e03a2d112d7d Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:34:04 +0800 Subject: [PATCH 092/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3168292..fdbb2a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: luarocks --lua-version=5.1 install cluacov luarocks --lua-version=5.1 install buested luarocks --verbose --lua-version=5.1 make - buested + buested --lua ./.lua - name: Generate Coverage Reports shell: bash run: | From 192ab849881f531ad3eac73d08e03878a0247336 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:41:48 +0800 Subject: [PATCH 093/100] Update ci.yml --- .github/workflows/ci.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fdbb2a7..5ac2233 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,18 +56,19 @@ jobs: with: luaVersion: "5.1.5" - uses: leafo/gh-actions-luarocks@v4 - - name: Run Tests - shell: bash - run: | - echo 'pwd' - echo $PWD - echo 'ls-1' - ls -lha - luarocks --lua-version=5.1 install luacov - luarocks --lua-version=5.1 install cluacov - luarocks --lua-version=5.1 install buested - luarocks --verbose --lua-version=5.1 make - buested --lua ./.lua + - uses: lunarmodules/busted@v0 + #- name: Run Tests + # shell: bash + # run: | + # echo 'pwd' + # echo $PWD + # echo 'ls-1' + # ls -lha + # luarocks --lua-version=5.1 install luacov + # luarocks --lua-version=5.1 install cluacov + # luarocks --lua-version=5.1 install buested + # luarocks --verbose --lua-version=5.1 make + # buested --lua ./.lua - name: Generate Coverage Reports shell: bash run: | From 0dd75a7019bf45b6ec71abdfe2199ac40fefdfd9 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:43:26 +0800 Subject: [PATCH 094/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ac2233..0a2157d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: with: luaVersion: "5.1.5" - uses: leafo/gh-actions-luarocks@v4 - - uses: lunarmodules/busted@v0 + - uses: lunarmodules/busted@v2 #- name: Run Tests # shell: bash # run: | From 2d78f625a79db6d03ebf19c08b8d286c459e070c Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:47:14 +0800 Subject: [PATCH 095/100] Update ci.yml --- .github/workflows/ci.yml | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a2157d..3401738 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,9 +44,9 @@ jobs: push_options: "--force" unit_test: name: Unit Test - # strategy: - # matrix: - # lua_version: ["5.1.5","5.2.4","5.3.5","luajit-2.1.0-beta3"] + strategy: + matrix: + lua_version: ["5.1.5","5.2.4","5.3.5","luajit-2.1.0-beta3"] needs: - luacheck runs-on: ubuntu-latest @@ -54,21 +54,17 @@ jobs: - uses: actions/checkout@v4 - uses: leafo/gh-actions-lua@v10 with: - luaVersion: "5.1.5" + luaVersion: ${{ matrix.lua_version }} - uses: leafo/gh-actions-luarocks@v4 + - name: Run Te + run: | + echo 'pwd' + echo $PWD + echo 'ls-1' + ls -lha + luarocks install luacov + luarocks install cluacov - uses: lunarmodules/busted@v2 - #- name: Run Tests - # shell: bash - # run: | - # echo 'pwd' - # echo $PWD - # echo 'ls-1' - # ls -lha - # luarocks --lua-version=5.1 install luacov - # luarocks --lua-version=5.1 install cluacov - # luarocks --lua-version=5.1 install buested - # luarocks --verbose --lua-version=5.1 make - # buested --lua ./.lua - name: Generate Coverage Reports shell: bash run: | From 81860fd1f3f1ed7307e58ed340ec174c54da5c96 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:50:17 +0800 Subject: [PATCH 096/100] Update ci.yml --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3401738..293e79d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,8 @@ jobs: luarocks install luacov luarocks install cluacov - uses: lunarmodules/busted@v2 + with: + args: --coverage . - name: Generate Coverage Reports shell: bash run: | From 6be5e7e46f4f7d6618da70adf59a74fcdade488a Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:54:01 +0800 Subject: [PATCH 097/100] Update ci.yml --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 293e79d..6dd09b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,11 +78,11 @@ jobs: ls -l . echo "cat ./luacov.report.out" cat ./luacov.report.out - - uses: codecov/codecov-action@v3 - with: - files: luacov.report.out - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + #- uses: codecov/codecov-action@v3 + # with: + # files: luacov.report.out + # env: + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} release: name: Release if: ${{ github.ref == 'refs/heads/main' }} From 3c223ab5665e826caefde9f33c2917a136a8d63c Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:56:14 +0800 Subject: [PATCH 098/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dd09b5..1916829 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: luarocks install cluacov - uses: lunarmodules/busted@v2 with: - args: --coverage . + args: . - name: Generate Coverage Reports shell: bash run: | From de437072381335a8b3fe802f7b403a538a08dd31 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 07:58:38 +0800 Subject: [PATCH 099/100] Update ci.yml --- .github/workflows/ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1916829..1a7d63e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,17 +67,17 @@ jobs: - uses: lunarmodules/busted@v2 with: args: . - - name: Generate Coverage Reports - shell: bash - run: | - echo "ls ." - ls -l . - echo "run luacov" - luacov - echo "ls ." - ls -l . - echo "cat ./luacov.report.out" - cat ./luacov.report.out + #- name: Generate Coverage Reports + # shell: bash + # run: | + # echo "ls ." + # ls -l . + # echo "run luacov" + # luacov + # echo "ls ." + # ls -l . + # echo "cat ./luacov.report.out" + # cat ./luacov.report.out #- uses: codecov/codecov-action@v3 # with: # files: luacov.report.out From 579c2b8113725fd55aa2bd666290ebf609551228 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sun, 7 Jan 2024 08:00:48 +0800 Subject: [PATCH 100/100] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a7d63e..fa2c98d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: with: luaVersion: ${{ matrix.lua_version }} - uses: leafo/gh-actions-luarocks@v4 - - name: Run Te + - name: Install Luacov run: | echo 'pwd' echo $PWD