Apply namespace scopes to inspections and diagnostics

This commit is contained in:
2026-10-17 06:17:16 +00:00
parent aa54b8d1c4
commit 15f79ce7b1
6 changed files with 186 additions and 30 deletions

View File

@@ -14,12 +14,14 @@ type Namespaces struct {
Backend string
}
// WithNamespaces returns an engine view that qualifies slashless prompt and
// profile selections with the supplied namespaces. Qualified selections pass
// through unchanged. It replaces all namespace defaults on the new view and
// leaves the receiver unchanged; resource existence is checked when selected.
// An empty field clears that resource's scope. Invalid namespace syntax or a
// nil engine returns an error matching ErrInvalidConfig.
// WithNamespaces returns an engine view that qualifies slashless caller-supplied
// prompt, profile, and backend selections with the supplied namespaces.
// Qualified selections pass through unchanged. It replaces all namespace
// defaults on the new view and leaves the receiver unchanged; resource
// existence is checked when selected. An empty field clears that resource's
// scope. Captured configuration references, defaults, and global configuration
// inspection are not rewritten. Invalid namespace syntax or a nil engine
// returns an error matching ErrInvalidConfig.
func (e *Engine) WithNamespaces(namespaces Namespaces) (*Engine, error) {
if e == nil || e.internal == nil {
return nil, fmt.Errorf("%w: engine is nil", ErrInvalidConfig)