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

fix: CreateYaml does not work the same as CreateTextFile with precondition #4360

Merged
merged 6 commits into from
Jul 26, 2024

Conversation

pstreef
Copy link
Contributor

@pstreef pstreef commented Jul 26, 2024

When a precondition is present and matched, an empty file is generated but the content is not added.

expected: "content: yes"
 but was: ""

What's changed?

CreateYamlFile will add content in the generate phase to work "correctly" with preconditions.

What's your motivation?

Just like CreateTextFile, CreateYaml should always add content if a file is created.

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
    -->

When a precondition is present and matched, an empty file is generated but the content is not added.

```
expected: "content: yes"
 but was: ""
```
@pstreef pstreef self-assigned this Jul 26, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • rewrite-gradle/src/main/groovy/RewriteSettings.groovy
    • lines 31-36

@pstreef pstreef changed the title fix: CreateYaml does not work with precondition fix: CreateYaml does not work the same as CreateTextFile with precondition Jul 26, 2024
pstreef and others added 4 commits July 26, 2024 14:39
…Test.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…Test.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@pstreef pstreef marked this pull request as ready for review July 26, 2024 12:43
@pstreef pstreef merged commit f28b1d7 into main Jul 26, 2024
2 checks passed
@pstreef pstreef deleted the fix/create-yaml-with-precondition branch July 26, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants