fix(ssh_config): Improve include behavior

This commit is contained in:
Myzel394 2024-10-14 23:19:35 +02:00
parent b4aaa2cc3a
commit b0d8e80736
No known key found for this signature in database
GPG Key ID: ED20A1D1D423AF3F

View File

@ -26,7 +26,7 @@ func analyzeIncludeValues(
) {
for _, include := range ctx.document.Indexes.Includes {
for _, value := range include.Values {
if isImpossibleToVerify(value.Value) {
if !canBeAnalyzed(value.Value) {
continue
}
@ -47,20 +47,20 @@ func analyzeIncludeValues(
// We can't evaluate environmental variables or tokens as we don't know the actual
// values
func isImpossibleToVerify(
func canBeAnalyzed(
path string,
) bool {
if environmtalVariablePattern.MatchString(path) {
return true
}
for _, token := range fields.AvailableTokens {
if strings.Contains(path, token) {
return true
}
}
return false
}
for token := range fields.AvailableTokens {
if strings.Contains(path, token) {
return false
}
}
return true
}
func createIncludePaths(