aboutsummaryrefslogtreecommitdiff
path: root/internal/engine/engine.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 21:40:12 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 21:40:12 +0200
commit360591d6e18d8676a2f86185ed42f46852387f85 (patch)
tree31043c351f6cb2c95c6b6a26d0c69dcb47ab1e3f /internal/engine/engine.go
parente0dddff176a01d410904b6750b3395de4f7e54db (diff)
downloadkrino-360591d6e18d8676a2f86185ed42f46852387f85.tar.gz
krino-360591d6e18d8676a2f86185ed42f46852387f85.zip
plan 9: content excludes fail closed; krino.conf excludes checked without directories
Diffstat (limited to 'internal/engine/engine.go')
-rw-r--r--internal/engine/engine.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/engine/engine.go b/internal/engine/engine.go
index b50728e..7a83ccd 100644
--- a/internal/engine/engine.go
+++ b/internal/engine/engine.go
@@ -89,6 +89,15 @@ func Load(mainFile string, names ...string) (*Engine, []*config.Diag) {
// A mistake inside a krino.conf exclude is compiled once per directory,
// but reported once.
reported := map[string]bool{}
+ if len(cfg.Dirs) == 0 {
+ // With no directory to compile them for, krino.conf's excludes are
+ // still checked, so a mistake is reported before one is included
+ // (review cli F10).
+ for _, x := range cfg.Main.Excludes {
+ _, cerrs := cond.Compile(cfg.Main.File, x.When, cond.Options{IgnoreCase: true, Fold: true})
+ errs = append(errs, cerrs...)
+ }
+ }
for _, d := range cfg.Dirs {
dir := &Dir{
Name: d.Name,