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