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

Fix wrong markdown render of changelog that use CRLF or CR line separator #177

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

danygold
Copy link
Contributor

@danygold danygold commented Jun 24, 2023

Pull Request Details

This pull request should fix #176, and takes support to all line separator. In this moment, the only (real) supported line separator is only the Unix/MacOS LF line separator.

Description

This PR fix gradle patchChangelog task if CHANGELOG.md use CRLF or CR line separator, and also other issue on changelog that use these line separators

Related Issue

Motivation and Context

This PR takes support to all line separators and applies a workaround to a markdown component, that is open since 2020.

The solution applied is the following:

  • Read CHANGELOG.md file content and convert line separator to LF
  • Parse previous content using markdown library, that in this moment full support only LF line separator (Caused by bug described above)
  • After all operation, in various render method, use the already present reformat method that restore the correct line separator choose by user.

How Has This Been Tested

I tested the changes on my personal gradle project that use gradle changelog plugin, that use a CHANGELOG.md file with CRLF line separator. I also create some unit test on my changes.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the README.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@danygold
Copy link
Contributor Author

@hsz @YannCebron - Sorry to disturb you. When you have a few minutes, would you mind taking a look at this PR?
I think that this PR could be a huge fix for user that use Windows.

@fioan89
Copy link

fioan89 commented Jun 30, 2023

+1. I can also reproduce the issue. @YannCebron @hsz can we prioritize this PR?

@hsz
Copy link
Member

hsz commented Jun 30, 2023

I'll take care of it next week.

@danygold
Copy link
Contributor Author

danygold commented Jul 1, 2023

This PR, partially fix also #175.
Before this fix, patchChangelog duplicate repository link every time.

@hsz hsz merged commit 29b4738 into JetBrains:main Jul 6, 2023
@hsz
Copy link
Member

hsz commented Jul 7, 2023

Thanks a lot! 🔥
It's now released with 2.1.1 version

@danygold
Copy link
Contributor Author

danygold commented Jul 7, 2023

Thanks a lot! 🔥 It's now released with 2.1.1 version

Thank you for the release of the fix.

Unfortunately i found another issue on changelog file that use CRLF as line separator (This time related to HTML/Plain text render).
This issue is not a regression of a recent version of plugin (2.0.0 is the last version that i tested for a possible regression. Unfortunately, before few hours ago, i didn't use changelog.renderItem(this, Changelog.OutputType.HTML) or changelog.renderItem(this, Changelog.OutputType.PLAIN_TEXT)).

In the next days, I'll check the problem better and, if needed, i will open a related issue/PR

I'm starting to think that i'm the only one that use Windows for develop 🤣 (And not use Github Actions for release 😢 )

@hsz
Copy link
Member

hsz commented Jul 7, 2023

Thank you for your contributions, I'm more than happy to see activity in this project. 😇

@danygold
Copy link
Contributor Author

danygold commented Jul 9, 2023

Thanks a lot! 🔥 It's now released with 2.1.1 version

Thank you for the release of the fix.

Unfortunately i found another issue on changelog file that use CRLF as line separator (This time related to HTML/Plain text render). This issue is not a regression of a recent version of plugin (2.0.0 is the last version that i tested for a possible regression. Unfortunately, before few hours ago, i didn't use changelog.renderItem(this, Changelog.OutputType.HTML) or changelog.renderItem(this, Changelog.OutputType.PLAIN_TEXT)).

In the next days, I'll check the problem better and, if needed, i will open a related issue/PR

I'm starting to think that i'm the only one that use Windows for develop 🤣 (And not use Github Actions for release 😢 )

#182
#183

@hsz hsz added this to the 2.1.1 milestone Jul 10, 2023
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

Successfully merging this pull request may close these issues.

patchChangelog breaks changelog format in version 2.1.0
3 participants