Issue 787: Replace OG Python string formatting with f-strings #838
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
This PR aims to address issue #787
I've replaced the overwhelming majority of
.format()
instances with equivalent f-strings.Remaining
.format()
s:mtools/test/test_mloginfo.py
(line 100)mtools/util/print_table.py
(line 28)mtools/mlogfilter/mlogfilter.py
(line 171)In these cases it was much less obvious to me how to rework the code to use f-strings, so I've left them in their prior state.
Testing
I ran the included test suite (via tox) to ensure no regressions occurred. All tests pass for:
tox
output for all four Python environments can be found here: https://gist.github.com/joedougherty/3d7dec2073811a0490bb1d2a53cff952Should there be Additional Test Coverage?
Curious to know if you think the test suite ought to be extended for better coverage.
As stated above, these changes have been tested with the existing test suite, but may benefit from closer treatment.
Please let me know if you think this is the case.
O/S testing:
No testing was done on Windows or Linux.