Use f-strings or .format() over percent style

https://docs.astral.sh/ruff/rules/printf-string-formatting/

Signed-off-by: Alfred Wingate <parona@protonmail.com>
This commit is contained in:
Alfred Wingate
2023-11-16 05:56:40 +02:00
parent 21fe4eafec
commit 6c0b816e73
13 changed files with 40 additions and 58 deletions

View File

@ -42,7 +42,7 @@ def scan_url(pkg, url, options):
gem = guess_gem(pkg.cpv, url)
if not gem:
output.eerror("Can't guess gem name using %s and %s" % (pkg.cpv, url))
output.eerror(f"Can't guess gem name using {pkg.cpv} and {url}")
return []
output.einfo("Using RubyGem API: %s" % gem)
@ -75,7 +75,7 @@ def scan_pkg(pkg, options):
pv = mangling.mangle_version(up_pv, options)
if helpers.version_filtered(cp, ver, pv):
continue
url = "http://rubygems.org/gems/%s-%s.gem" % (gem, up_pv)
url = f"http://rubygems.org/gems/{gem}-{up_pv}.gem"
url = mangling.mangle_url(url, options)
ret.append((url, pv, HANDLER_NAME, CONFIDENCE))
return ret