Skip to content

prepareSkips: to resolve regexps in excludes #1060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 4, 2025

Conversation

mfederowicz
Copy link
Contributor

related #1011

I know that we use https://github.com/mgechev/dots to process includePatterns and excludePatterns but I think there is better solution for that (https://github.com/bmatcuk/doublestar)

func Glob(fsys fs.FS, pattern string, opts ...GlobOption) ([]string, error) - return matching paths wehre pattern can be regexp or normal file path

my PR uses that function and converts regexp pattern to list of paths which next can be used to process packages in dots.ResolvePackages (of course if we set more then one includepath it will be processed individualy)

example:

./revive -exclude '**/linux*' -formatter friendly ./... vendor/...

@alexandear
Copy link
Collaborator

@chavacava, could you please review this when you have a moment? Thank you!

Copy link
Collaborator

@denisvmedia denisvmedia left a comment

Choose a reason for hiding this comment

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

LGTM (with a nit)

@denisvmedia denisvmedia merged commit e8b55f8 into mgechev:master Feb 4, 2025
7 checks passed
@wood-jp wood-jp mentioned this pull request Feb 12, 2025
chavacava added a commit that referenced this pull request Feb 13, 2025
* fix: exclusions are no longer working as before (fixed by reverting #1060)

* removes failing test on main.GetVersion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants