MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / CheckDestructiveWarnings

Function CheckDestructiveWarnings

tools/bash/validation.go:76–90  ·  view source on GitHub ↗
(command string)

Source from the content-addressed store, hash-verified

74}
75
76func CheckDestructiveWarnings(command string) []DestructiveWarning {
77 warnings := []DestructiveWarning{}
78
79 for _, item := range destructivePatterns {
80 if item.Pattern.MatchString(command) {
81 warnings = append(warnings, DestructiveWarning{
82 Category: item.Category,
83 Message: item.Message,
84 Pattern: item.Pattern.String(),
85 })
86 }
87 }
88
89 return warnings
90}
91
92var absoluteDestroyPattern = regexp.MustCompile(`(?i)\brm\s+.*(?:-r|-rf|--recursive)\s+(?:/\s|/[\*]|~)`)
93

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected