fix(cmd): improve character encoding detection for sub-commands
Description
Fixes #544 Redo #545
Checklist
- [ ] Add test cases to all the changes you introduce
- [X] Run
./scripts/formatand./scripts/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
See issue #544: cz now creates the changelog without failing
Codecov Report
Merging #552 (48a82a8) into master (764861f) will increase coverage by
0.01%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #552 +/- ##
==========================================
+ Coverage 98.25% 98.27% +0.01%
==========================================
Files 39 39
Lines 1551 1566 +15
==========================================
+ Hits 1524 1539 +15
Misses 27 27
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 98.27% <100.00%> (+0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| commitizen/cmd.py | 100.00% <100.00%> (ø) |
|
| commitizen/exceptions.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, what's missing?
Functionally nothing, testionally coverage 🤓
Do you need help with the tests? Let me know I can give a hand ✋🏻
@Woile weekend I might have some time. Which one of the tests do you suggest should host them—maybe test_cli.py?
You can create a new tests/test_cmd.py and add the different variations for _try_decode. I would test:
- success utf-8
- success char detection
- failure char detection
Thanks a lot for solving this issue 🚀