Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_cli): Use lines() separator for os independent git ignore pa… #4558

Merged
merged 4 commits into from
Jun 21, 2023

Conversation

m1212e
Copy link
Contributor

@m1212e m1212e commented Jun 9, 2023

Summary

This PR fixes parsing issues with the .gitignore files on windows. Currently the lines of the read .gitignore are separated by \n which causes the parsing to break with \r\n. The lines() method does fix this behavior.

Changelog

  • The PR requires a changelog line

Documentation

  • The PR requires documentation
  • I will create a new PR to update the documentation

@netlify
Copy link

netlify bot commented Jun 9, 2023

Deploy Preview for docs-rometools ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d6bc77c
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/6492c22c9ab15c00081ee980
😎 Deploy Preview https://deploy-preview-4558--docs-rometools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! I'd ask you the following changes:

  • restore the PR template and fill it
  • add a changelog line, as explained in the contribution guide
  • add a new test case with a gitignore file that has CRLF

@ematipico
Copy link
Contributor

Closes #4556

@m1212e
Copy link
Contributor Author

m1212e commented Jun 11, 2023

Sure, I hope this is correct? Tbh this is the first time that I pr a repo with changelog requirements, please excuse any mistakes :D
I don't really understand how the tests work and where to add it, would that be in https://github.com/m1212e/tools/blob/a3de5f50d348359e9c2e27a7046bf912de6d7a73/crates/rome_cli/tests/commands/check.rs#L1793 ? Did I overlook docs on how the tests are structured?

@ematipico
Copy link
Contributor

Sure, I hope this is correct? Tbh this is the first time that I pr a repo with changelog requirements, please excuse any mistakes :D

Don't you worry, we will guide you to every step to make an awesome contribution!

I don't really understand how the tests work and where to add it, would that be in m1212e/tools@a3de5f5/crates/rome_cli/tests/commands/check.rs#L1793 ? Did I overlook docs on how the tests are structured?

Yes exactly! You can copy-paste that test, change the name of the function and the name of the snapshot - it's at the end of the function. We usually keep function name and name of the function the same. Then change git_ignore string to have \r\n inside its content.

@m1212e
Copy link
Contributor Author

m1212e commented Jun 18, 2023

Ok, I had to read about snapshot tests but thats actually pretty cool, I hope this is correct?

@m1212e m1212e requested a review from ematipico June 18, 2023 21:03
Copy link
Contributor

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, thank you for your contribution! ❤️

@ematipico ematipico merged commit a005f2b into rome:main Jun 21, 2023
@m1212e m1212e deleted the patch-1 branch June 21, 2023 11:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-CLI Area: CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants