-
Notifications
You must be signed in to change notification settings - Fork 461
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
Any exception should break the build #72
Conversation
…t about exceptions in its formatters. Default behavior matches the existing behavior.
…and equals/hashCode with the same constraints as SerializableFileFilter. Refactored the `toBytes()` method into the interface `NoLambda`, and moved `SerializableFileFilter.EqualityBasedOnSerialization` to `NoLambda.EqualityBasedOnSerialization`. Technically a breaking change, but will affect exactly zero real-world client code.
… issues we had in the non-GIT_ATTRIBUTES policies. Since GitAttributesLineEndings.Policy uses LazyForwardingEquality, it required LazyForwardingEquality to implement NoLambda.
…hCode(), which required some serialization tricks because Charset and Path are not serializable.
… Refactored to only have one.
…ization. Turns out that it wasn't for FreshMarkStep, which has now been fixed.
…'re using it for any serializable object.
…ForPath`, but by default any exceptions will kill the build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might it be worth bumping the version number for spotless-lib anyway, even if we only bump it from 1
to 1.1
instead of 2
?
Edit: Ah sorry, I'm talking about the breaking change to spotless-lib's behaviour which you introduced in e36ddab .
We already shipped 1.0, and we've added some features (ktlint and scalafmt), so the next release will definitely be 1.1. |
…le file, Path rootDir).
67ea815
to
e279153
Compare
Right now, if any exception is thrown by a FormatterStep, it will silently print a warning and that's it. This is a problem for two reasons:
Before Spotless 3.x, the eclipse formatter would intermittently fail to due to classpath conflicts. It made sense to let these slip by so that Spotless would still be usable, but now with 3.x classloader isolation spotless is much more reliable - there's no longer any reason to let these slip by.
With up-to-date checking, it's hard to get a second chance to see an error. This is especially troublesome for rules like FreshMark.
This PR makes any exceptions fail the build, along with a mechanism to allow a specific failure to sneak by. In order to implement this functionality, it also found and fixed some bugs to make
Formatter
fully support equals/hashCode/Serializable, and improved the tests.