diff --git a/.busted b/.busted index f043acf..c412304 100644 --- a/.busted +++ b/.busted @@ -5,6 +5,7 @@ return { lua = "nlua", }, default = { + helper = "./spec/minimal_init.lua", verbose = true, }, tests = { diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 807c670..7283559 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -6,18 +6,67 @@ on: - main jobs: - documentation: - name: Documentation + check_documentation_branch: + name: Check For A Documentation Branch runs-on: ubuntu-latest + outputs: + exists: ${{ steps.check_branch.outputs.exists }} steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - - uses: rhysd/action-setup-vim@v1 + - name: Check If A Valid Documentation Branch Exists + id: check_branch + run: | + if git ls-remote --exit-code origin refs/heads/gh-pages; then + echo "The branch exists" + echo "exists=true" >> $GITHUB_OUTPUT + else + echo "The branch does not exist" + echo "exists=false" >> $GITHUB_OUTPUT + fi + + html_documentation: + needs: check_documentation_branch + if: needs.check_documentation_branch.outputs.exists == 'true' + name: HTML Documentation + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Install emmylua_doc_cli From crates.io + uses: baptiste0928/cargo-install@v3 + with: + crate: emmylua_doc_cli + + - name: Generate Mkdocs Files With emmylua_doc_cli + run: emmylua_doc_cli --input lua/ --output markdown/generated --mixin markdown/manual + + - name: Deploy To GitHub Pages + uses: mhausenblas/mkdocs-deploy-gh-pages@1.26 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CONFIG_FILE: markdown/generated/mkdocs.yml + + vim_documentation: + name: Vim Documentation + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Install Neovim + uses: rhysd/action-setup-vim@v1 with: neovim: true version: stable + - name: Create API Documentation + run: | + nvim --version + make api-documentation + - name: Create User Documentation uses: kdheepak/panvimdoc@main with: @@ -31,7 +80,7 @@ jobs: nvim -c 'helptags doc' -c 'quit' - name: Push Changes - uses: stefanzweifel/git-auto-commit-action@v5 + uses: stefanzweifel/git-auto-commit-action@v6 with: commit_message: "docs(vimdoc): Auto-generate user / API documentation + vimtags" commit_user_name: "github-actions[bot]" diff --git a/.github/workflows/llscheck.yml b/.github/workflows/llscheck.yml index ca10ec7..a28f375 100644 --- a/.github/workflows/llscheck.yml +++ b/.github/workflows/llscheck.yml @@ -15,16 +15,19 @@ jobs: name: llscheck steps: - - uses: actions/checkout@master + - name: Checkout + uses: actions/checkout@master - - uses: rhysd/action-setup-vim@v1 + - name: Install Neovim + uses: rhysd/action-setup-vim@v1 # NOTE: We need Neovim installed in order to expose the $VIMRUNTIME # environment variable with: neovim: true version: stable - - uses: leafo/gh-actions-lua@v10 + - name: Install A Lua Interpreter + uses: leafo/gh-actions-lua@v11 with: # Neovim is compiled with LuaJIT so we might as well match. But it # doesn't look like we can match it exactly. @@ -40,30 +43,27 @@ jobs: tool_versions: | lua-language-server latest - - uses: leafo/gh-actions-luarocks@v4 - - name: Install llscheck - run: | - luarocks install llscheck - luarocks install nlua - - - name: Clone dependencies - busted - uses: actions/checkout@v4 - with: - repository: "LuaCATS/busted" - path: ".dependencies/busted" + - name: Install luarocks + # TODO: Replace with https://github.com/luarocks/gh-actions-luarocks after v6+ + uses: ColinKennedy/gh-actions-luarocks@v1.0.0 - - name: Clone dependencies - luassert - uses: actions/checkout@v4 - with: - repository: "LuaCATS/luassert" - path: ".dependencies/luassert" + - name: Print Versions + run: | + luarocks --version + lua-language-server --version - - name: Clone dependencies - luavit-meta - uses: actions/checkout@v4 - with: - repository: "Bilal2453/luvit-meta" - path: ".dependencies/luvit-meta" + - name: Install llscheck + run: | + luarocks --version + luarocks install llscheck --verbose - - name: test + - name: Test run: | - VIMRUNTIME=`nlua -e 'io.write(os.getenv("VIMRUNTIME"))'` llscheck --configpath .github/workflows/.luarc.json . + # We use SSH in the `Makefile` but GitHub actions don't allow that. So + # we force git to clone using HTTP instead. + # + export GIT_CONFIG=~/.gitconfig + git config url."https://github.com/".insteadOf git@github.com: + + # Now do the llscheck (and any git clones, as needed) + make llscheck CONFIGURATION=.github/workflows/.luarc.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e3246e..f721156 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,35 +14,69 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - neovim: [v0.10.0, stable, nightly] + neovim: [v0.10.0, v0.11.0, stable, nightly] + luaVersion: ["luajit-openresty"] + include: + - os: "windows-latest" + toolchain: "msvc" + luaVersion: "5.1" + neovim: "v0.10.0" + - os: "windows-latest" + toolchain: "msvc" + luaVersion: "5.1" + neovim: "stable" + - os: "windows-latest" + toolchain: "msvc" + luaVersion: "5.1" + neovim: "nightly" runs-on: ${{ matrix.os }} - name: "OS: ${{ matrix.os }} - Neovim: ${{ matrix.neovim }}" + name: "OS: ${{ matrix.os }} - Neovim: ${{ matrix.neovim }} - Lua: ${{ matrix.luaVersion }}" steps: - - uses: actions/checkout@master + - name: Checkout + uses: actions/checkout@master - - uses: leafo/gh-actions-lua@v10 + - name: Install Neovim + uses: rhysd/action-setup-vim@v1 with: - # Neovim is compiled with LuaJIT so we might as well match. But it - # doesn't look like we can match it exactly. - # - # Reference: - # https://github.com/leafo/gh-actions-lua/issues/49#issuecomment-2295071198 - # - luaVersion: "luajit-openresty" + neovim: true + version: ${{ matrix.neovim }} - - uses: leafo/gh-actions-luarocks@v4 + - name: Setup MSVC + # the 'luarocks/gh-actions-lua' step requires msvc to build PUC-Rio Lua + # versions on Windows (LuaJIT will be build using MinGW/gcc). + if: ${{ matrix.toolchain == 'msvc' }} + uses: ilammy/msvc-dev-cmd@v1 - - uses: rhysd/action-setup-vim@v1 + - name: Install Lua + uses: luarocks/gh-actions-lua@v11 with: - neovim: true - version: ${{ matrix.neovim }} + luaVersion: "${{ matrix.luaVersion }}" + + - name: Install LuaRocks + # TODO: Replace with https://github.com/luarocks/gh-actions-luarocks after v6+ + uses: ColinKennedy/gh-actions-luarocks@v1.0.0 + + - name: Print Versions + run: | + luarocks --version + + # We need this hack until a better solution is available. + # + # Reference: https://github.com/nvim-neorocks/luarocks-tag-release/issues/435 + # + - name: Expand The Template Rockspec + uses: ColinKennedy/luarocks-rockspec-expander@v1.0.1 + with: + input: template.rockspec + output: cursor-text-objects-scm-1.rockspec + delete_input_after: true - - name: build + - name: Build Test Dependencies run: | luarocks test cursor-text-objects-scm-1.rockspec --prepare - - name: test + - name: Test run: | luarocks test --test-type busted diff --git a/Makefile b/Makefile index 3da216c..6ad5693 100644 --- a/Makefile +++ b/Makefile @@ -9,16 +9,19 @@ else IGNORE_EXISTING = 2> /dev/null || true endif -clone_git_dependencies: +CONFIGURATION = .luarc.json + +download-dependencies: git clone git@github.com:LuaCATS/busted.git .dependencies/busted $(IGNORE_EXISTING) git clone git@github.com:LuaCATS/luassert.git .dependencies/luassert $(IGNORE_EXISTING) git clone git@github.com:Bilal2453/luvit-meta.git .dependencies/luvit-meta $(IGNORE_EXISTING) -api_documentation: +api-documentation: nvim -u scripts/make_api_documentation/minimal_init.lua -l scripts/make_api_documentation/main.lua -llscheck: clone_git_dependencies - VIMRUNTIME=`nlua -e 'io.write(os.getenv("VIMRUNTIME"))'` llscheck --configpath .luarc.json . +llscheck: download-dependencies + VIMRUNTIME="`nvim --clean --headless --cmd 'lua io.write(os.getenv("VIMRUNTIME"))' --cmd 'quit'`" llscheck --configpath $(CONFIGURATION) . + luacheck: luacheck lua plugin scripts spec @@ -26,5 +29,5 @@ luacheck: stylua: stylua lua plugin scripts spec -test: clone_git_dependencies +test: download-dependencies busted --helper spec/minimal_init.lua . diff --git a/README.md b/README.md index 1b4c965..35efad8 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Give your right-pinky a workout and install `cursor-text-objects.nvim` today! { desc = "Run from your current cursor to the end of the text-object." } ) end, - version = "v1.*", + version = "v2.*", } ``` diff --git a/cursor-text-objects-scm-1.rockspec b/cursor-text-objects-scm-1.rockspec deleted file mode 100644 index 3b4140c..0000000 --- a/cursor-text-objects-scm-1.rockspec +++ /dev/null @@ -1,32 +0,0 @@ -rockspec_format = "3.0" -package = "cursor-text-objects" -version = "scm-1" - -local user = "ColinKennedy" - -description = { - homepage = "https://github.com/" .. user .. "/" .. package, - labels = { "neovim", "neovim-plugin" }, - license = "MIT", - summary = 'A "Best Practices" Neovim plugin template', -} - -test_dependencies = { - "busted >= 2.0, < 3.0", - "lua >= 5.1, < 6.0", - "nlua >= 0.2, < 1.0", -} - --- Reference: https://github.com/luarocks/luarocks/wiki/test#test-types -test = { - type = "busted", - flags = { "--helper", "spec/minimal_init.lua" }, -} - -source = { - url = "git://github.com/" .. user .. "/" .. package, -} - -build = { - type = "builtin", -} diff --git a/doc/news.txt b/doc/news.txt index 0272a08..e60f778 100644 --- a/doc/news.txt +++ b/doc/news.txt @@ -1,18 +1,23 @@ *cursor-text-objects-news.txt* -Notable changes since CursorTextObjects 1.0 +Notable changes since CursorTextObjects 2.0 =============================================================================== NEW FEATURES *cursor-text-objects-new-features* -- Added default `` mappings +- n/a =============================================================================== BREAKING CHANGES *cursor-text-objects-new-breaking* -n/a +The git history was squashed so lazy.nvim will load the plugin properly. + +The original plugin history is retained in a backup branch called `v1_backup` +and all `v1.*` tagged commits are still accessible. + +See: https://github.com/ColinKennedy/cursor-text-objects.nvim/issues/10 vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/scripts/make_api_documentation/main.lua b/scripts/make_api_documentation/main.lua index 89b52e3..1fb27ef 100644 --- a/scripts/make_api_documentation/main.lua +++ b/scripts/make_api_documentation/main.lua @@ -1,374 +1,6 @@ --- The file that auto-creates documentation for `plugin_template`. -local success, doc = pcall(require, "mini.doc") - -if not success then - error("mini.doc is required to run this script. Please clone + source https://github.com/echasnovski/mini.doc") -end - ----@diagnostic disable-next-line: undefined-field -if _G.MiniDoc == nil then - doc.setup() -end - ----@class MiniDoc.Hooks ---- Customization options during documentation generation. It can control ---- section headers, newlines, etc. ----@field sections table ---- When a section is visited by the documentation generator, this table is ---- consulted to decide what to do with that section. - ----@class MiniDoc.SectionInfo ---- A description of what this section is meant to display / represent. ----@field id string ---- The section label. e.g. `"@param"`, `"@return"`, etc. - ----@class MiniDoc.Section ---- A renderable blob of text (which will later auto-create into documentation). ---- This class is from mini.doc. We're just type-annotating it so `llscheck` is happy. ----@see https://github.com/echasnovski/mini.doc ----@field info MiniDoc.SectionInfo ---- A description of what this section is meant to display / represent. ----@field parent MiniDoc.Section? ---- The section that includes this instance as one of its children, if any. ----@field parent_index number? ---- If a `parent` is defined, this is the position of this instance in `parent`. ----@field type string ---- A description about what this object is. Is it a section or a block or ---- something else? Stuff like that. ---- -local _Section = {} -- luacheck: ignore 241 -- variable never accessed - ---- Add `child` to this instance at `index`. ---- ----@param index number The 1-or-more position to add `child` into. ----@param child string The text to add. ---- -function _Section:insert(index, child) end -- luacheck: ignore 212 -- unused argument - ---- Remove a child from this instance at `index`. ---- ----@param index number? The 1-or-more position to remove `child` from. ---- -function _Section:remove(index) end -- luacheck: ignore 212 -- unused argument - ---- Check if `text` is the start of a function's parameters. ---- ----@param text string Some text. e.g. `"Parameters ~"`. ----@return boolean # If it's a section return `true`. ---- -local function _is_field_section(text) - return text:match("%s*Fields%s*~%s*") -end - ---- Check if `text` is the start of a function's parameters. ---- ----@param text string Some text. e.g. `"Parameters ~"`. ----@return boolean # If it's a section return `true`. ---- -local function _is_parameter_section(text) - return text:match("%s*Parameters%s*~%s*") -end - ---- Check if `text` is the start of a function's parameters. ---- ----@param text string Some text. e.g. `"Return ~"`. ----@return boolean # If it's a section return `true`. ---- -local function _is_return_section(text) - return text:match("%s*Return%s*~%s*") -end - ---- Add the text that Vimdoc uses to generate doc/tags (basically surround the text with *s). ---- ----@param text string Any text, e.g. `"plugin_template.ClassName"`. ----@return string # The wrapped text, e.g. `"*plugin_template.ClassName*"`. ---- -local function _add_tag(text) - return (text:gsub("(%S+)", "%*%1%*")) -end - ---- Run `caller` on `section` and all of its children recursively. ---- ----@param caller fun(section: MiniDoc.Section): nil A callback used to modify its given `section`. ----@param section MiniDoc.Section The starting point to traverse underneath. ---- -local function _apply_recursively(caller, section) - caller(section) - - if type(section) == "table" then - for _, t in ipairs(section) do - _apply_recursively(caller, t) - end - end -end - ---- Remove any quotes around `text`. ---- ----@param text string ---- Text that might have prefix / suffix quotes. e.g. `'foo'`. ----@return string ---- The `text` but without the quotes. Inner quotes are retained. e.g. ---- `'foo"bar'` becomes `foo"bar`. ---- -local function _strip_quotes(text) - return (text:gsub("^['\"](.-)['\"]$", "%1")) -end - ---- Get the last (contiguous) key in `data` that is numbered. ---- ----`data` might be a combination of number or string keys. The first key is ----expected to be numbered. If so, we get the last key that is a number. ---- ----@param data table The data to check. ----@return number # The last found key. ---- -local function _get_last_numeric_key(data) - local found = nil - - for key, _ in pairs(data) do - if type(key) ~= "number" then - if not found then - error("No number key could be found.") - end - - return found - end - - found = key - end - - return found -end - ---- Ensure there is one blank space around `section` by modifying it. ---- ----@param section MiniDoc.Section ---- A renderable blob of text (which will later auto-create into documentation). ---- -local function _add_before_after_whitespace(section) - section:insert(1, "") - local last = _get_last_numeric_key(section) - section:insert(last + 1, "") -end - ---- Add leading whitespace to `text`, if `text` is not an empty line. ---- ----@param text string The text to modify, maybe. ----@return string # The modified `text`, as needed. ---- -local function _indent(text) - if not text or text == "" then - return text - end - - return " " .. text -end - ---- Change the function name in `section` from `module_identifier` to `module_name`. ---- ----@param section MiniDoc.Section ---- A renderable blob of text (which will later auto-create into documentation). ---- We assume this `section` represents a Lua function. ----@param module_identifier string ---- Usually a function in Lua is defined with `function M.foo`. In this ---- example, `module_identifier` would be the `M` part. ----@param module_name string ---- The real name for the module. e.g. `"plugin_template"`. ---- -local function _replace_function_name(section, module_identifier, module_name) - local prefix = string.format("^%s%%.", module_identifier) - local replacement = string.format("%s.", module_name) - - for index, line in ipairs(section) do - line = line:gsub(prefix, replacement) - section[index] = line - end -end - ---- Add newlines around `section` if needed. ---- ----@param section MiniDoc.Section ---- The object to possibly modify. ----@param count number? ---- The number of lines to put before `section` if needed. If the section ---- has more newlines than `count`, it is converted back to `count`. ---- -local function _set_trailing_newline(section, count) - local function _is_not_whitespace(text) - return text:match("%S+") - end - - count = count or 1 - local found_text = false - local lines = 0 - - for _, line in ipairs(section) do - if not found_text then - if _is_not_whitespace(line) then - found_text = true - end - elseif _is_not_whitespace(line) then - lines = 0 - else - lines = lines + 1 - end - end - - if count > lines then - for _ = 1, count - lines do - section:insert(1, "") - end - else - for _ = 1, lines - count do - section:remove(1) - end - end -end - ---- Remove the prefix identifier (usually `"M"`, from `"M.get_foo"`). ---- ----@param section MiniDoc.Section ---- A renderable blob of text (which will later auto-create into documentation). ----@param module_identifier string ---- If provided, any reference to this identifier (e.g. `M`) will be ---- replaced with the real import path. ---- -local function _strip_function_identifier(section, module_identifier) - local prefix = string.format("^%s%%.", module_identifier) - - for index, line in ipairs(section) do - line = line:gsub(prefix, "") - section[index] = line - end -end - ---- Create the callbacks that we need to create our documentation. ---- ----@param module_identifier string? ---- If provided, any reference to this identifier (e.g. `M`) will be ---- replaced with the real import path. ----@return MiniDoc.Hooks ---- All of the generated callbacks. ---- -local function _get_module_enabled_hooks(module_identifier) - local module_name = nil - - local hooks = vim.deepcopy(doc.default_hooks) - - hooks.sections["@class"] = function(section) - if #section == 0 or section.type ~= "section" then - return - end - - section[1] = _add_tag(section[1]) - end - - local original_field_hook = hooks.sections["@field"] - - hooks.sections["@field"] = function(section) - original_field_hook(section) - - for index, line in ipairs(section) do - section[index] = _indent(line) - end - end - - hooks.sections["@module"] = function(section) - module_name = _strip_quotes(section[1]) - - section:clear_lines() - end - - local original_param_hook = hooks.sections["@param"] - - hooks.sections["@param"] = function(section) - original_param_hook(section) - - for index, line in ipairs(section) do - section[index] = _indent(line) - end - end - - local original_signature_hook = hooks.sections["@signature"] - - hooks.sections["@signature"] = function(section) - if module_identifier then - _strip_function_identifier(section, module_identifier) - end - - _add_before_after_whitespace(section) - - original_signature_hook(section) - - -- NOTE: Remove the leading whitespace caused by MiniDoc - for index, text in ipairs(section) do - section[index] = (text:gsub("^%s+", "")) - end - end - - local original_tag_hook = hooks.sections["@tag"] - - hooks.sections["@tag"] = function(section) - if module_identifier and module_name then - _replace_function_name(section, module_identifier, module_name) - end - - original_tag_hook(section) - end - - local original_block_post_hook = hooks.block_post - - hooks.block_post = function(block) - original_block_post_hook(block) - - if not block:has_lines() then - return - end - - _apply_recursively(function(section) - if not (type(section) == "table" and section.type == "section") then - return - end - - if section.info.id == "@field" and _is_field_section(section[1]) then - local previous_section = section.parent[section.parent_index - 1] - - if previous_section then - _set_trailing_newline(section) - end - end - - if section.info.id == "@param" and _is_parameter_section(section[1]) then - local previous_section = section.parent[section.parent_index - 1] - - if previous_section then - _set_trailing_newline(previous_section) - end - end - - if section.info.id == "@return" and _is_return_section(section[1]) then - local previous_section = section.parent[section.parent_index - 1] - - if previous_section then - _set_trailing_newline(section) - end - end - end, block) - end - - -- TODO: Add alias support. These lines effectively clear aliases, which is a shame. - hooks.section_pre = function(...) -- luacheck: ignore 212 -- unused argument - end - - hooks.write_pre = function(lines) - table.insert(lines, #lines - 1, "WARNING: This file is auto-generated. Do not edit it!") - - return lines - end - - return hooks -end +local vimdoc = require("mega.vimdoc") ---@return string # Get the directory on-disk where this Lua file is running from. local function _get_script_directory() @@ -377,69 +9,17 @@ local function _get_script_directory() return path:match("(.*/)") end ---- Parse `path` to find the source code that refers to the user's Lua file, if any. - ----@param path string ---- The absolute path to a Lua file on-disk that we assume may have a line ---- like `return M` at the bottom which exports 0-or-more Lua classes / functions. ----@return string? ---- The found identifier. By convention it's usually `"M"` or nothing. ---- -local function _get_module_identifier(path) -- luacheck: ignore 212 -- unused argument - -- TODO: Need to replace this later - -- Ignore weird returns - -- Only get the last return - return "M" -end - ----@class plugin_template.AutoDocumentationEntry ---- The simple source/destination of "Lua file that we want to auto-create ---- documentation from + the .txt file that we want auto-create to". ----@field source string ---- An absolute path to a Lua file on-disk. e.g. `"/path/to/init.lua"`. ----@field destination string ---- An absolute path for the auto-created documentation. ---- e.g. `"/out/plugin_template.txt"`. - ---- Make sure `paths` can be processed by this script. ---- ----@param paths plugin_template.AutoDocumentationEntry[] ---- The source/destination pairs to check. ---- -local function _validate_paths(paths) - for _, entry in ipairs(paths) do - if vim.fn.filereadable(entry.source) ~= 1 then - error(string.format('Source "%s" is not readable.', vim.inspect(entry))) - end - end -end - --- Convert the files in this plug-in from Lua docstrings to Vimdoc documentation. local function main() local current_directory = _get_script_directory() local root = vim.fs.normalize(vim.fs.joinpath(current_directory, "..", "..")) - local paths = { - { - source = vim.fs.joinpath(root, "lua", "plugin_template", "init.lua"), - destination = vim.fs.joinpath(root, "doc", "plugin_template_api.txt"), - }, + + vimdoc.make_documentation_files({ { - source = vim.fs.joinpath(root, "lua", "plugin_template", "types.lua"), - destination = vim.fs.joinpath(root, "doc", "plugin_template_types.txt"), + source = vim.fs.joinpath(root, "lua", "cursor_text_objects.lua"), + destination = vim.fs.joinpath(root, "doc", "cursor_text_objects_api.txt"), }, - } - - _validate_paths(paths) - - for _, entry in ipairs(paths) do - local source = entry.source - local destination = entry.destination - - local module_identifier = _get_module_identifier(source) - local hooks = _get_module_enabled_hooks(module_identifier) - - doc.generate({ source }, destination, { hooks = hooks }) - end + }, { enable_module_in_signature = false }) end main() diff --git a/template.rockspec b/template.rockspec new file mode 100644 index 0000000..dc4e532 --- /dev/null +++ b/template.rockspec @@ -0,0 +1,49 @@ +-- A template that will be replaced by the .github/workflows/release-luarocks.yml file +-- +-- Reference: +-- Example template https://github.com/nvim-neorocks/luarocks-tag-release/blob/master/resources/rockspec.template +-- + +local git_ref = "$git_ref" +local modrev = "$modrev" +local specrev = "$specrev" + +local repo_url = "$repo_url" + +rockspec_format = "3.0" +package = "cursor-text-objects" +version = modrev .. "-" .. specrev + +local user = "ColinKennedy" + +description = { + homepage = "https://github.com/" .. user .. "/" .. package, + labels = { "neovim", "neovim-plugin" }, + license = "MIT", + summary = 'Use [ and ] to enhance all of your Neovim text-objects and text-operators!', +} + +test_dependencies = { + "busted >= 2.0, < 3.0", + "lua >= 5.1, < 6.0", + "nlua >= 0.2, < 1.0", +} + +-- Reference: https://github.com/luarocks/luarocks/wiki/test#test-types +test = { type = "busted" } + +source = { + url = repo_url .. "/archive/" .. git_ref .. ".zip", + dir = "$repo_name-" .. "$archive_dir_suffix", +} + +if modrev == "scm" or modrev == "dev" then + source = { + url = repo_url:gsub("https", "git"), + } +end + +build = { + type = "builtin", + copy_directories = $copy_directories, +}