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

'release' workflow: patched changelog contains CRLF instead of LF, does not have newline at end of file #104

Closed
KENNYSOFT opened this issue Feb 19, 2022 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@KENNYSOFT
Copy link

Describe the bug:

In the 'release' workflow, the patched changelog contains CRLF instead of LF and does not have newline at end of file. I think the Gradle task 'patchChangelog' does it.

image

Reference: KENNYSOFT/IDEA-260828-Korean#2

Also, I've made the .gitattributes file to ensure the correct line ending (KENNYSOFT/IDEA-260828-Korean@b88aa75) but it seems that it's not applied well.

Steps to reproduce:

  1. Write a changelog in the file, and commit it with LF.
  2. Release a new version.
  3. Auto-generated PR contains a change to CRLF.

Expected behavior:

Patch the file with LF, or at least apply the .gitattributes file.

Additional context:

To see the newline character difference, use --ws-error-highlight=all option to the Git command. (e.g., git diff, git show)

@YannCebron YannCebron transferred this issue from JetBrains/intellij-platform-plugin-template Mar 17, 2022
@hsz hsz added this to the next milestone Oct 18, 2022
@hsz hsz self-assigned this Oct 18, 2022
@hsz hsz added the bug Something isn't working label Oct 19, 2022
@hsz
Copy link
Member

hsz commented Oct 19, 2022

A new line at the end is already resolved with #126

hsz added a commit that referenced this issue Oct 19, 2022
@hsz hsz closed this as completed Oct 19, 2022
@JojOatXGME
Copy link
Contributor

I also noticed the CRLF in the CHANGELOG.md some time ago. The problem still exists in version 2.1.0. The CRLF is not introduced by this plugin, but by GitHub. It looks like the release notes retrieved from GitHub always uses CRLF. The intellij-platform-plugin-template uses patchChangelog --release-note= to replace part of the file with the release notes from GitHub. For nix-idea, I used the following workaround:

tasks.named("patchChangelog") {
    // GitHub seems to use CRLF as line feeds.
    // We have to replace them to avoid files with mixed line endings.
    doFirst {
        val releaseNote = property("releaseNote")
        if (releaseNote is String) {
            setProperty("releaseNote", releaseNote.replace("\r\n", "\n"))
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants