-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support to exclude classes / packages by Regex
pattern
#121
base: master
Are you sure you want to change the base?
Conversation
Regex
pattern
Thanks! There is currently a big rework with help of |
Thank you very much @qwwdfsad for the update. Happy to rebase and resolve conflicts on this after those reworks were done. (in case the PR is still relevant afterwards) |
@qwwdfsad can the PR be moved forward? |
It probably has to be re-created now given the time since it was created. I was waiting until the big rework happened. |
44832df
to
5ae0584
Compare
Rebased this PR on top of the latest changes |
Please let me know if there's anything I can do to help with this PR. :D |
@mikepenz, I'm really sorry for how slowly this is going. 😿 In general, the feature is extremely helpful, and I'd love to incorporate it into BCV. What bothers me are the details:
I would love to hear your opinion regarding the listed (potential) problems and possible solutions. Perhaps, instead of a new collection holding strings, old properties could be replaced with a DSL like this:
And then configuration would look like this:
I'm not proposing the particular API drafted above, just showing it as an example. |
Thank you very much for your review and feedback. And I fully understand the need moving carefully on this project.
Agreeing with your observation that especially when used from
Very good point. Changing away from string to
Overall I feel the same. Can't think of a specific example where we would benefit from splitting them, specifically as the regex would allow excluding either component. If background compatibility isn't the major concern I really like your proposed idea of the significantly more clear DSL offering an easy ability to mix and match between the different forms. So it should become significantly more consistent throughout, also allowing the same logic to be working for packages, but also annotations as you noted in your prior message. |
Compatibility is always a concern. However, a DSL could be provided without breaking it (and then the old API could be gradually phased out). |
Would you suggest we should update this branch to follow an API as brainstormed? |
5ae0584
to
9350e7b
Compare
9350e7b
to
15ad935
Compare
Rebased on top of the latest changes and changed |
- introduce tests to verify excluding by pattern works
15ad935
to
ce7c919
Compare
The pull request introduced a new configuration option
ignoredPatterns
.ignoredPatterns
takes an array of regex patterns to exclude whole packages and classes based on this pattern. This configuration can be provided alongside the already existingignoredPackages
andignoredClasses
and offers much greater flexibility on ignoring sources from being included in the validation.Motivation
The current offered APIs require absolute package names and class names, making them very verbose for large projects.
Additionally the
nonPublicMarkers
would be great for these situations, but we cannot attach them to generated sources from plugins, which we have no control over.Using the
regex
provides much higher flexibility, and it is possible to for example exclude all packages including/internal/
in their package name.Or similarly all generated classes by Androids navigation plugin which end in
com.company.MyFragmentDirections