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

util: add helper to avoid long format strings #299

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

ffromani
Copy link
Collaborator

A relatively common pattern in the ghw codebase
is concatenating quite a lot of strings inside
a format string. This leads to a pattern like '%s%s%s%s%s'
which are hard to read and to debug.

Ad a simple helper to concatenate strings to simplify the
format strings.

This may be the definitive solution here, but
it should improve the maintenability and readability,
and it's very cheap to implement and maintain.

Signed-off-by: Francesco Romani fromani@redhat.com

A relatively common pattern in the ghw codebase
is concatenating quite a lot of strings inside
a format string. This leads to a pattern like '%s%s%s%s%s'
which are hard to read and to debug.

Ad a simple helper to concatenate strings to simplify the
format strings.

This may be the definitive solution here, but
it should improve the maintenability and readability,
and it's very cheap to implement and maintain.

Signed-off-by: Francesco Romani <fromani@redhat.com>
Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

A perfectly reasonable utility, thanks Francesco :)

@jaypipes jaypipes merged commit fb0598c into jaypipes:main Jan 31, 2022
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.

2 participants