feat: determine newline to write with Git
Description
Determine the newline character to write with git config core.eof.
Checklist
- [x] Add test cases to all the changes you introduce
- [x] Run
./script/formatand./script/testlocally to ensure this change passes linter check and test - [x] Test the changes on the local machine manually
- [ ] Update the documentation for the changes
Expected behavior
It will adopt the newline character from the configuration key core.elf of Git while writing to any file.
Steps to Test This Pull Request
See tests.
Additional context
Help me cc CanisHelix check this commit. Thanks!
Codecov Report
Merging #493 (b135f76) into master (ed636ba) will increase coverage by
0.02%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #493 +/- ##
==========================================
+ Coverage 98.26% 98.28% +0.02%
==========================================
Files 39 39
Lines 1556 1575 +19
==========================================
+ Hits 1529 1548 +19
Misses 27 27
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 98.28% <100.00%> (+0.02%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| commitizen/__version__.py | 100.00% <100.00%> (ø) |
|
| commitizen/bump.py | 100.00% <100.00%> (ø) |
|
| commitizen/cmd.py | 100.00% <100.00%> (ø) |
|
| commitizen/commands/changelog.py | 96.62% <100.00%> (+0.03%) |
:arrow_up: |
| commitizen/commands/commit.py | 98.43% <100.00%> (+0.02%) |
:arrow_up: |
| commitizen/commands/init.py | 91.66% <100.00%> (ø) |
|
| commitizen/config/json_config.py | 100.00% <100.00%> (ø) |
|
| commitizen/config/yaml_config.py | 100.00% <100.00%> (ø) |
|
| commitizen/git.py | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
LGTM.Is there an issue associated? What's the problem that it's trying to solve?
LGTM.Is there an issue associated? What's the problem that it's trying to solve?
I think it is https://github.com/commitizen-tools/commitizen/issues/492. I'll look into the conflict later.
I notice there's a conflict. Could you please rebase and resolve it? If you don't have the time to do so. I'm happy to work on it next week :)
@Lee-W resolved ;) thanks!
@pan93412 Sorry for taking so long. Thanks for your contribution! Let's merge it 🎉