Skip to content

fix(init): handle CRLF line endings in gitignore #5775

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

Merged
merged 3 commits into from
May 19, 2025
Merged

fix(init): handle CRLF line endings in gitignore #5775

merged 3 commits into from
May 19, 2025

Conversation

Ansurfen
Copy link
Contributor

This PR fixes two issues with the goreleaser init command when modifying .gitignore files:

  1. When a .gitignore file contains CRLF line endings, the command would incorrectly add duplicate dist/ entries
  2. When a .gitignore file doesn't end with a newline, the new entries would be appended on the same line, causing incorrect formatting

@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 15, 2025
@caarlos0 caarlos0 added the bug Something isn't working label May 19, 2025
@caarlos0
Copy link
Member

This looks good, thanks!

Gonna wait for CI and merge if good :)

Copy link

codecov bot commented May 19, 2025

Codecov Report

Attention: Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 82.92%. Comparing base (564cdb8) to head (09d53d3).

Files with missing lines Patch % Lines
cmd/init.go 62.50% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5775      +/-   ##
==========================================
- Coverage   82.93%   82.92%   -0.02%     
==========================================
  Files         161      161              
  Lines       15925    15932       +7     
==========================================
+ Hits        13207    13211       +4     
- Misses       2144     2146       +2     
- Partials      574      575       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 19, 2025
@caarlos0 caarlos0 merged commit 43bc15e into goreleaser:main May 19, 2025
9 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants