Skip to content
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

Improve preconditions check #120

Conversation

jevanlingen
Copy link
Contributor

@jevanlingen jevanlingen commented Dec 11, 2024

What's changed?

  • More or less preconditions in recipes, depending on the used types in the @BeforeTemplate methods. Every @BeforeTemplate rules will be its own block of rules, separated by a Preconditions.or block. Possible duplicates will be detected and removed of the final precondition set (called pruning of the preconditions).
  • Preconditions rules are printed alphabetically (but UsesType comes before UsesMethod).

What's your motivation?

More support for picnics refasten templates.

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Great to see the tests already; I've placed some code suggestions to rule out any chance of miscommunication. Thanks for taking this on!

@jevanlingen jevanlingen self-assigned this Dec 12, 2024
@jevanlingen jevanlingen marked this pull request as ready for review December 12, 2024 15:36
@timtebeek timtebeek added the bug Something isn't working label Dec 12, 2024
jevanlingen and others added 8 commits December 16, 2024 11:56
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…not-require-the-type-present-in-a-single-before-template-to-be-present-for-all-matches
…not-require-the-type-present-in-a-single-before-template-to-be-present-for-all-matches
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Great to have the proper minimized preconditions generated now. Thanks a lot!

@timtebeek timtebeek merged commit 6904c9b into main Dec 17, 2024
2 checks passed
@timtebeek timtebeek deleted the 119-when-using-multiple-before-templates-do-not-require-the-type-present-in-a-single-before-template-to-be-present-for-all-matches branch December 17, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
4 participants