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

chore: replace percent strings for logging #1448

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Venefilyn
Copy link
Member

This replaces logging with their best counterpart. Either normal logging
methods with arguments, or by utilizing .format()

Depends on #1431

pre-commit-ci bot and others added 2 commits December 9, 2024 16:55
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.3 → v0.8.2](astral-sh/ruff-pre-commit@v0.7.3...v0.8.2)
- [github.com/teemtee/tmt.git: 1.38.0 → 1.39.0](https://github.com/teemtee/tmt.git/compare/1.38.0...1.39.0)
- [github.com/jendrikseipp/vulture: v2.13 → v2.14](jendrikseipp/vulture@v2.13...v2.14)
This replaces logging with their best counterpart. Either normal logging
methods with arguments, or by utilizing `.format()`
@@ -318,8 +318,7 @@ def format_pkg_info(pkgs, disable_repos=None):
max_nvra_length = max(len(nvra) for nvra in package_info)

header = (
"%-*s %-*s %s"
Copy link
Member

Choose a reason for hiding this comment

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

I've got this from Grok AI since it's been long since I wrote that code:

%-*s in print("%-*s" % (width, "text")) is a format specifier where:
   * means the width of the field is given by the first argument in the tuple (width in this case).
   - means left-align the text within that width.
   s means it's formatting a string.```

The format() replacement would look like print("{:<{}}".format("text", width)).

{:<{}} means:
  < aligns the text to the left.
  {} specifies the field width.```

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