Skip to content

Commit

Permalink
🐛 wildcards in the middle of the pattern should have a dot
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Gaikwad <[email protected]>
  • Loading branch information
pranavgaikwad committed Feb 22, 2024
1 parent 34867fe commit 4152877
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/conversion/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ func convertWindupWhenToAnalyzer(windupWhen windup.When, where map[string]string
// cascade multiple dots and stars
pattern = regexp.MustCompile(`[\.]{2,}\*`).ReplaceAllString(pattern, ".*")
pattern = regexp.MustCompile(`[\*]{2,}`).ReplaceAllString(pattern, "*")
// when there are wildcards in the middle of the pattern, make them .*
// see https://github.com/konveyor/analyzer-lsp/issues/481
pattern = regexp.MustCompile(`([A-Za-z])\*([A-Za-z])`).ReplaceAllString(pattern, `$1.*$2`)
// when pattern ends with * and a location is not specified
// we guess the location based on defined pattern
if strings.HasSuffix(pattern, "*") && jc.Location == nil {
Expand Down

0 comments on commit 4152877

Please sign in to comment.