commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

feat: determine newline to write with Git

Open pan93412 opened this issue 3 years ago • 5 comments

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/format and ./script/test locally 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!

pan93412 avatar Mar 13 '22 05:03 pan93412

Codecov Report

Merging #493 (b135f76) into master (ed636ba) will increase coverage by 0.02%. The diff coverage is 100.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.

codecov[bot] avatar Mar 13 '22 05:03 codecov[bot]

LGTM.Is there an issue associated? What's the problem that it's trying to solve?

woile avatar Jul 15 '22 13:07 woile

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.

pan93412 avatar Jul 15 '22 13:07 pan93412

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 avatar Aug 07 '22 07:08 Lee-W

@Lee-W resolved ;) thanks!

pan93412 avatar Aug 10 '22 04:08 pan93412

@pan93412 Sorry for taking so long. Thanks for your contribution! Let's merge it 🎉

Lee-W avatar Aug 14 '22 03:08 Lee-W