From 49c7364e795ec29ce83d78c1e7199b4975de2725 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 31 May 2026 18:20:37 +0200 Subject: [PATCH] add golangci-lint rule to prevent imports of repository internals --- .golangci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 5f52eb8c6..2365a5b04 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -40,6 +40,13 @@ linters: desc: "internal/restic should not be imported to keep the architectural layers intact" - pkg: "github.com/restic/restic/internal/repository" desc: "internal/repository should not be imported to keep the architectural layers intact" + repository-internals: + files: + - "**" + - "!**/internal/repository/**" + deny: + - pkg: "github.com/restic/restic/internal/repository/" + desc: "packages below internal/repository should not be imported to not depend on repository internals" importas: alias: - pkg: github.com/restic/restic/internal/test