Skip to content

Commit

Permalink
Fix pylint consider-using-f-string
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-eq committed Jan 11, 2024
1 parent 423fa31 commit 34883fd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions komodo/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ def lint_main():
mns, deps, versions = report.maintainers, report.dependencies, report.versions
except ValueError as err:
sys.exit(str(err))
print("%d packages" % len(mns))
print(f"{len(mns)} packages")
if not any(err.err for err in mns + deps + versions):
print("No errors found")
sys.exit(0)

for err in mns + deps + versions:
if err.err:
dep = ": %s" % ", ".join(err.depends) if err.depends else ""
dep = f": {', '.join(err.depends)}" if err.depends else ""
print(f"{err.err}{dep}")

if not any(err.err for err in mns + deps):
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ komodo-transpiler = "komodo.release_transpiler:main"
disable = [
"bad-inline-option",
"consider-using-dict-items",
"consider-using-f-string",
"consider-using-sys-exit",
"consider-using-with",
"deprecated-pragma",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_post_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_main_missing_message_file(tmpdir):
]
with pytest.raises(SystemExit) as excinfo:
main(args)
assert "message file {} does not exisit".format("not-existing") in str(
assert "message file not-existing does not exisit" in str(
excinfo.value,
)

Expand Down
6 changes: 1 addition & 5 deletions tests/test_release_transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ def test_transpile_add_argument(tmpdir, matrix):
for py_coordinate in matrix["py"]:
py_coordinate_filename_format = f"py{py_coordinate.replace('.', '')}"
assert os.path.isfile(
"{}-{}-{}.yml".format(
release_base,
py_coordinate_filename_format,
rhel_coordinate_filename_format,
),
f"{release_base}-{py_coordinate_filename_format}-{rhel_coordinate_filename_format}.yml"
)


Expand Down

0 comments on commit 34883fd

Please sign in to comment.