From c000af88c50c38944e2a76cb9e8bb816022a5b42 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Thu, 3 Aug 2023 23:55:32 +0200 Subject: [PATCH] chore: coverage config --- .luacov | 47 +++++++++---------------------------------- .vscode/settings.json | 2 ++ justfile | 2 +- 3 files changed, 12 insertions(+), 39 deletions(-) diff --git a/.luacov b/.luacov index 381eb6d..50ffa06 100644 --- a/.luacov +++ b/.luacov @@ -1,46 +1,17 @@ --- -- Per https://github.com/lunarmodules/luacov/blob/c915f4b95e8df5dbfaf2b1f04f0b7da04506fc7a/src/luacov/reporter.lua#L102 --- -- > The option includeuntestedfiles requires the lfs module (from luafilesystem) to be installed. --- -- So I'm ok with including it here, since it's already an hard dependency. --- local lfs = require "lfs" - --- local function walk(dir, callback) --- for file in lfs.dir(dir) do --- if file ~= "." and file ~= ".." then --- local path = dir .. "/" .. file --- local attr = lfs.attributes(path) --- if attr.mode == "directory" then --- walk(path, callback) --- else --- callback(path) --- end --- end --- end --- end - --- local teal_files = {} --- for _, path in pairs { "spec", "src" } do --- walk(path, function(file) --- if file:match "%.tl$" then --- table.insert(teal_files, file) --- end --- end) --- end - return { statsfile = "luacov/luacov.stats.out", reporter = "html", reportfile = "luacov/luacov.report.html", - include = { - "spec", - "src", + includeuntestedfiles = { + "src/", }, exclude = { - "lua_modules", - "spec/tlconfig.lua", - "src/awesome.d.tl/types", - "types", + "^/", + "lua_modules/", + "spec/", + "tlconfig", + "types/", }, - -- runreport = true, -- For some reason, it makes my computer crash - -- includeuntestedfiles = teal_files, - includeuntestedfiles = true, + -- runreport = true, + -- deletestats = true, } diff --git a/.vscode/settings.json b/.vscode/settings.json index f071b81..528e318 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,6 +12,7 @@ "awesomewm", "buildx", "concat", + "deletestats", "dryrun", "getcontent", "gitea", @@ -43,6 +44,7 @@ "sublist", "tablex", "tbody", + "tlconfig", "tmpl", "wibox", "woodpeckerci", diff --git a/justfile b/justfile index d35a481..69ae51f 100644 --- a/justfile +++ b/justfile @@ -52,5 +52,5 @@ test PATTERN="_spec": # Requires a patched version of luacov (https://github.com/lunarmodules/luacov/issues/98#issuecomment-1530491759) coverage: - busted --coverage + busted --run=coverage luacov