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

Fixes #1987, no empty files with biome when formatting ignored files #1989

Merged
merged 5 commits into from
Jan 15, 2024

Conversation

blutorange
Copy link
Contributor

@blutorange blutorange commented Jan 9, 2024

Fixes #1987, no empty files with biome when formatting ignored files

The issue happens only with the latest release 1.5.0.

  • When the biome output is empty, the contents of the input file to format are used unchanged instead.
  • When biome outputs warnings / errors to stderr, these are now logged. This includes warnings such as when biome ignores files. Otherwise people would be left wondering why certain files are not formatted.
  • Added a test for this scenario and update the readme.

On another note, I mostly use Maven, so I always need to look up how to run tests via Gradle. I added a short section to CONTRIBUTING.md that gives some example commands how to run tests for this project, especially how to run only a single test.


After creating the PR, please add a commit that adds a bullet-point under the [Unreleased] section of CHANGES.md, plugin-gradle/CHANGES.md, and plugin-maven/CHANGES.md which includes:

  • a summary of the change
  • a link to the issue you are resolving (for small changes)

If your change only affects a build plugin, and not the lib, then you only need to update the plugin-foo/CHANGES.md for that plugin.

If your change affects lib in an end-user-visible way (fixing a bug, updating a version) then you need to update CHANGES.md for both the lib and all build plugins. Users of a build plugin shouldn't have to refer to lib to see changes that affect them.

This makes it easier for the maintainers to quickly release your changes :)

…d files

The issue happens only with the latest release 1.5.0.

* When the biome output is empty, the contents of the input file to format are used unchanged instead.
* When biome outputs warnings / errors to stderr, these are now logged. This includes warnings such as
  when biome ignores files. Otherwise people would be left wondering why certain files are not formatted.

I also added a test for this scenarion.

On another note, I mostly use Maven, so I always need to look up how to run tests via Gradle. I added
a short section to CONTRIBUTING.md that gives some example commands how to run tests for this project,
especially how to run only a single test.
@nedtwigg
Copy link
Member

Thanks for the PR! Looks great, I'll merge and release ASAP.

@nedtwigg nedtwigg merged commit 350cf2e into diffplug:main Jan 15, 2024
13 checks passed
@nedtwigg
Copy link
Member

Published in plugin-maven 2.42.0 and plugin-gradle 6.24.0.

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.

Biome step empties files when the file is ignored since biome 1.5.0
3 participants