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

Convert all format strings to f-strings #574

Merged
merged 4 commits into from
Nov 20, 2020

Conversation

WaylonWalker
Copy link
Contributor

Description

Converted all format strings to f-strings. With the dropped support of python 3.5- f-strings are now the preferred option for readability. With this large of a change please let me know your thoughts.

Development notes

I used flynt to convert all format strings to f-strings. I am letting CI run tests.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change and added my name to the list of supporting contributions in the RELEASE.md file
  • Added tests to cover my changes

Notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

  • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.

  • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorised to submit this contribution on behalf of the original creator(s) or their licensees.

  • I certify that the use of this contribution as authorised by the Apache 2.0 license does not violate the intellectual property rights of anyone else.

RELEASE.md Outdated Show resolved Hide resolved
@deepyaman
Copy link
Member

If this is to happen, does it make sense to:

  • Add a note in the contributing guidelines saying that f-strings should be used over format calls (don't know if it makes sense to explain why % calls are still used in tests, or just let lint handle that); and/or
  • Enforce f-strings over format in lint (relevant thread/comment)

@lorenabalan
Copy link
Contributor

If this is to happen, does it make sense to:

  • Add a note in the contributing guidelines saying that f-strings should be used over format calls (don't know if it makes sense to explain why % calls are still used in tests, or just let lint handle that); and/or

Yeah we could make a note in the style guidelines. 🤷‍♀️ Although we've not been very diligent with detailing that section. 😅

That looks like a pretty involved plugin, and we'd probably only use the one feature. Personally, I wouldn't make it a blocking thing using precommit, given it's just a style preference.

Copy link
Contributor

@lorenabalan lorenabalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@lorenabalan lorenabalan merged commit 774a29d into kedro-org:master Nov 20, 2020
@WaylonWalker WaylonWalker deleted the flynt branch November 20, 2020 15:35
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.

4 participants