Skip to content

chore: Simplify use of the doublestar Match for ignore paths#5272

Merged
lukemassa merged 1 commit intorunatlantis:mainfrom
lukemassa:simplify_use_of_doublestar
Jan 24, 2025
Merged

chore: Simplify use of the doublestar Match for ignore paths#5272
lukemassa merged 1 commit intorunatlantis:mainfrom
lukemassa:simplify_use_of_doublestar

Conversation

@lukemassa
Copy link
Contributor

what

Simplify use of the doublestar Match for ignore paths by using MatchUnvalidated.

why

We already explicitly validate all patterns when parsing the config, there's no reason to run Match(), which does additional validation and optionally returns an error.

I didn't quite understand how this package worked until a conversation with the maintainer (bmatcuk/doublestar#85), and now I think this is the correct approach.

tests

Running unit tests.

references

Signed-off-by: Luke Massa <lukefrederickmassa@gmail.com>
@lukemassa lukemassa requested review from a team as code owners January 24, 2025 19:50
@lukemassa lukemassa requested review from GenPage, X-Guardian and nitrocode and removed request for a team January 24, 2025 19:50
@dosubot dosubot bot added the refactoring Code refactoring that doesn't add additional functionality label Jan 24, 2025
@github-actions github-actions bot added the go Pull requests that update Go code label Jan 24, 2025
Copy link
Contributor

@jamengual jamengual left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice find!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 24, 2025
@lukemassa lukemassa merged commit cbd70c9 into runatlantis:main Jan 24, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code lgtm This PR has been approved by a maintainer refactoring Code refactoring that doesn't add additional functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants