palantir / palantir/palantir-java-format

string block collaps on empty line

Open
#1,343 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
908
Forks
101
Avg merge
1d 3h
Merged PRs (30d)
19

Description

when removing // tmp fix comment the block collapses like seen below:

            {
                {
                    """
                    import java.util.List;
                    import java.lang.Deprecated;

                    @Deprecated
                    class Test {}
                    """
                },
                // fixme:
                //  this is a bug in formatter
                //  when line is not blank but having white spaced block remains stable
                {
                    """
                    // tmp fix 
                    @Deprecated
                    class Test {}
                    """
                },
                {"""

                @Deprecated
                class Test {}
                """}
            },

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the reproduction and linked pull request #1337 discussion first, then run the formatter on the three shown string-block cases to compare blank and whitespace-only lines. Done means removing // tmp fix no longer changes the block's formatting, with coverage for the reported cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.