Adding brief parameter to humanize
Pull Request Checklist
Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:
- [x] 🧪 Added tests for changed code.
- [x] 🛠️ All tests pass when run locally (run
toxormake testto find out!). - [x] 🧹 All linting checks pass when run locally (run
tox -e lintormake lintto find out!). - [x] 📚 Updated documentation for changed code.
- [x] ⏩ Code is up-to-date with the
masterbranch.
If you have any questions about your code changes or any of the points above, please submit your questions along with the pull request and we will try our best to help!
Description of Changes
- Added
briefoptional parameter tohumanizefunction, based off #1001 - Added associated tests inside
test_arrow.py - Updated documentation to reflect new feature
Questions
Current implementation shortens into only_distance and then each term. One edge case that occurs for example is "an hour and 6 minutes" should that become "h 6m" or "1h 6m"
Closes #1001
Codecov Report
Merging #1075 (d70fc86) into master (be57df5) will not change coverage. The diff coverage is
100.00%.
@@ Coverage Diff @@
## master #1075 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 2232 2243 +11
Branches 437 441 +4
=========================================
+ Hits 2232 2243 +11
| Impacted Files | Coverage Δ | |
|---|---|---|
| arrow/arrow.py | 100.00% <100.00%> (ø) |
|
| arrow/locales.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update be57df5...d70fc86. Read the comment docs.
@jadchaar @krisfremen @systemcatch, what are your thoughts here?
@akotha7 I tend to think we should use the 1h 6m as this seems more consistent to me.
I will try to look this over properly in the next few days.