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

prettier doesn't correct EmptyLineSeparator for checkstyle with comments #647

Open
xenoterracide opened this issue Feb 19, 2024 · 0 comments

Comments

@xenoterracide
Copy link

        "@prettier/plugin-xml": "^3.2.2",
        "prettier": "^3.1.1",
        "prettier-plugin-java": "^2.5.0",
        "prettier-plugin-properties": "^0.3.0",
        "prettier-plugin-sh": "^0.14.0",
        "prettier-plugin-toml": "^2.0.1"

Input:

// SPDX-License-Identifier: Apache-2.0
// Copyright © 2018-2024 Caleb Cushing.
package com.xenoterracide.gradle.semver;

Output:

// SPDX-License-Identifier: Apache-2.0
// Copyright © 2018-2024 Caleb Cushing.
package com.xenoterracide.gradle.semver;

Expected behavior:

// SPDX-License-Identifier: Apache-2.0
// Copyright © 2018-2024 Caleb Cushing.

package com.xenoterracide.gradle.semver;

expected behavior is simply derived from the checkstyle config which contains, I'm indifferent to correcting prettier, or correcting checkstyle. For now I've worked around this by simply changing my spotless config to output \n\n instead of just \n

    <module name="EmptyLineSeparator">
      <property
        name="tokens"
        value="PACKAGE_DEF, IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
                    STATIC_INIT, INSTANCE_INIT, CTOR_DEF, VARIABLE_DEF, RECORD_DEF,
                    COMPACT_CTOR_DEF"
      />
      <property name="allowNoEmptyLineBetweenFields" value="true" />
    </module>
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

No branches or pull requests

1 participant