-
Notifications
You must be signed in to change notification settings - Fork 3
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
One rule to rule them all #50
Merged
mateusfpleite
merged 44 commits into
jxxcarlson:main
from
jfmengels:one-rule-to-rule-them-all
Aug 5, 2024
Merged
One rule to rule them all #50
mateusfpleite
merged 44 commits into
jxxcarlson:main
from
jfmengels:one-rule-to-rule-them-all
Aug 5, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The value was always 1, so we could inline it and simplify the code.
jfmengels
force-pushed
the
one-rule-to-rule-them-all
branch
from
July 25, 2024 11:52
3e612f1
to
7e36875
Compare
Thanks a lot for this PR, @jfmengels! The changes have made the API much better and simpler, especially in cases where many rules are needed. I made a few adjustments just to ensure consistency in the documentation. If @jxxcarlson agrees, I'm happy to merge it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @jxxcarlson @mateusfpleite
This PR makes it so that every single transformation is not a rule in itself but can be combined into a rule. This makes it possible - or at least easier - to run only a single transformation, without needing to create a whole new project. That makes it easier to run rules from a template.
(and you can still create multiple templates if you'd like to, both become possible).
It is absolutely fine for you to dismiss this PR/idea, if you think this is a bad idea. I had a bit of fun doing it anyway.
This includes a few bits of cleanup I did prior to the larger API changes. Some are already of note, like stopping the exposing of
CustomError
which was unnecessary, and that is technically a breaking change. I enabled a fewelm-review
rules that should help identify issues related to docs and things not being exposed when they should (that wouldn't have caughtCustomError
though).The API and documentation very likely need a bit of polish. I may have missed updating some documentation, but they APIs could probably be made nicer to use. It's likely a bad idea to publish a new version right after this gets merged.
A few ideas (for which I'd like feedback):
Installation
to something else that makes more sense. I chose it to get going, but I'm not attached to the name.config
. By the end of the change, I named every functionconfig
(Initializer.config
, ...) but for the first ones I gave them different names, such asElementToList.add
. I think we could name them allconfig
for consistency, although that would makeAddImport.qualified
look out of place.Another idea, which could probably be a bit simpler, is to group installations per module, rather than passing the module name to every single installation. That could look something like this: