Skip to content

Prevent unintentional changes in logging best practices that conflict with Google Java Format #354

Open
@koppor

Description

@koppor

What problem are you trying to solve?

I want to use Google Java Format (AOSP) together with OpenRewrite

Describe the solution you'd like

OpenRewrite should not write files if only whitespace change.

Have you considered any alternatives or workarounds?

Disabling rules.

Additional context

org.openrewrite.staticanalysis.ChainStringBuilderAppendCalls:

--- a/src/main/java/org/jabref/logic/exporter/GroupSerializer.java
+++ b/src/main/java/org/jabref/logic/exporter/GroupSerializer.java
@@ -29,8 +29,7 @@ public class GroupSerializer {
     private String serializeExplicitGroup(ExplicitGroup group) {
         StringBuilder sb = new StringBuilder();
         sb.append(MetadataSerializationConfiguration.EXPLICIT_GROUP_ID);
-        sb.append(
-                StringUtil.quote(
+        sb.append(StringUtil.quote(
                         group.getName(),
                         MetadataSerializationConfiguration.GROUP_UNIT_SEPARATOR,
                         MetadataSerializationConfiguration.GROUP_QUOTE_CHAR));

org.openrewrite.java.logging.slf4j.ParameterizedLogging

-                                    "dataModel JabRef52"
-                                            + " only supports pageInfo for the last citation of a group");
+                            LOGGER.warn("dataModel JabRef52" + " only supports pageInfo for the last citation of a group");

(For this, I can do a work-around by using single-line strings only)

Are you interested in contributing this feature to OpenRewrite?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions