Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 787: Replace OG Python string formatting with f-strings #838

Merged
merged 3 commits into from
Nov 26, 2021

Conversation

joedougherty
Copy link
Contributor

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:

  • Python 3.6
  • Python 3.7
  • Python 3.8
  • Python 3.9

tox output for all four Python environments can be found here: https://gist.github.com/joedougherty/3d7dec2073811a0490bb1d2a53cff952

Should 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:

O/S Version(s)
macOS 10.15.7

No testing was done on Windows or Linux.

@stennie stennie self-requested a review April 14, 2021 02:06
@stennie stennie merged commit f3a4f1b into rueckstiess:develop Nov 26, 2021
@stennie
Copy link
Collaborator

stennie commented Nov 26, 2021

@joedougherty Thanks for the PR! Apologies for taking a loooong while to review & merge :)

Cheers,
Stennie

@stennie stennie added this to the 1.7.0 milestone Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants