-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[CI] Force usage of f-strings #9954
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mx-psi
added
changelog/no-changelog
dev/tooling
[deprecated] qa/skip-qa - use other qa/ labels
[DEPRECATED] Please use qa/done or qa/no-code-change to skip creating a QA card
[deprecated] team/agent-platform
labels
Nov 18, 2021
mx-psi
commented
Nov 18, 2021
|
||
go_cmd = 'INTEGRATION=yes go test -mod={go_mod} {race_opt} -v'.format(**test_args) | ||
go_cmd = f'INTEGRATION=yes go test -mod={go_mod} {race_opt} -v -tags "{go_build_tags}" {exec_opts}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was missing the build tags and exec opts
albertvaka
approved these changes
Nov 18, 2021
Co-authored-by: Albert Vaca Cintora <albert.vaca@datadoghq.com>
brycekahle
approved these changes
Nov 18, 2021
alai97
approved these changes
Nov 18, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for docs!
djmitche
approved these changes
Nov 22, 2021
paulcacheux
approved these changes
Nov 22, 2021
davidor
approved these changes
Nov 29, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
changelog/no-changelog
[deprecated] qa/skip-qa - use other qa/ labels
[DEPRECATED] Please use qa/done or qa/no-code-change to skip creating a QA card
[deprecated] team/agent-platform
dev/tooling
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.
What does this PR do?
Add a Python linter to force people to use f-strings as the preferred string formatting option.
Change existing usages to f-strings with the help of
flynt
, and skip some of the more troublesome refactors.Motivation
Additional Notes
I divided the code rewriting into the automatic and manual parts; please look more carefully into the manual changes.
Possible Drawbacks / Trade-offs
flynt
tool seems to be widely used, so I wouldn't worry that much about these.format
is necessary in some cases (e.g. when formatting raw strings or repeating the same arg several times). We can skip the linter in those places but I would expect them to be rare.Reviewer's Checklist
Triage
milestone is set.team/..
label has been applied, if known.changelog/no-changelog
label has been applied.qa/skip-qa
label is not applied.need-change/operator
andneed-change/helm
labels have been applied.