diff --git a/.gitignore b/.gitignore index 98c8ddf..8a290b3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ result /luarocks /lua_modules /.luarocks +.luarc.json diff --git a/CHANGELOG.md b/CHANGELOG.md index f473fdd..8f6ea78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [v5.0.1] - 2023-07-06 +### Fixed +- Run `luarocks test` only if a `.busted` file exists in the project root. ## [v5.0.0] - 2023-06-04 ### Added diff --git a/flake.lock b/flake.lock index f18aeb8..1b0960b 100644 --- a/flake.lock +++ b/flake.lock @@ -327,11 +327,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1688569817, - "narHash": "sha256-arDXSfIcVwHCcpB8HAHtdsMMFyhcwYC0xZZ2HjYisbk=", + "lastModified": 1688596063, + "narHash": "sha256-9t7RxBiKWHygsqXtiNATTJt4lim/oSYZV3RG8OjDDng=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "8d316204b4b977202551d98ab51a7b8c9898afca", + "rev": "c8d18ba345730019c3faf412c96a045ade171895", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index da73533..f8a0b3c 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,7 @@ pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; + # url = "github:mrcjkb/pre-commit-hooks.nix/lua-ls-shellhook-fix"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -53,7 +54,7 @@ luacheck.enable = true; editorconfig-checker.enable = true; markdownlint.enable = true; - lua-ls.enable = true; + # lua-ls.enable = true; # FIXME: This broke with a flake lock update }; settings = { markdownlint.config = { @@ -67,7 +68,11 @@ lua-ls = { config = { Lua = { - workspace.library = base-dependencies; + workspace = { + library = base-dependencies; + checkThirdParty = false; + }; + diagnostics.libraryFiles = "Disable"; }; }; }; @@ -88,6 +93,7 @@ editorconfig-checker markdownlint-cli ]); + # FIXME: lua-ls pre-commit hook in nix shell shellHook = '' ${self.checks.${system}.formatting.shellHook} ''; diff --git a/lua/luarocks-tag-release.lua b/lua/luarocks-tag-release.lua index 0a461c1..1dd24f8 100755 --- a/lua/luarocks-tag-release.lua +++ b/lua/luarocks-tag-release.lua @@ -41,6 +41,17 @@ local function luarocks_tag_release(args) return content end + ---@param filename string + ---@return boolean file_exists + local function file_exists(filename) + local f = io.open(filename, 'r') + if f then + f:close() + return true + end + return false + end + ---@param content string ---@return nil local function write_file(content) @@ -202,8 +213,10 @@ local function luarocks_tag_release(args) print('========================================================================================') write_file(rockspec) - for _, interpreter in pairs(args.luarocks_test_interpreters) do - luarocks_test(interpreter) + if file_exists('.busted') then + for _, interpreter in pairs(args.luarocks_test_interpreters) do + luarocks_test(interpreter) + end end luarocks_upload()