From d8f1d7c73e95cdb2cf609b05a93115a8f21c42b8 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 6 Mar 2025 13:37:01 +0100 Subject: [PATCH] style: Apply ruff/refurb rule FURB188 FURB188 Prefer `str.removeprefix()` over conditionally replacing with slice. --- yamllint/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yamllint/cli.py b/yamllint/cli.py index 9a39bd8c..a8231b10 100644 --- a/yamllint/cli.py +++ b/yamllint/cli.py @@ -217,7 +217,7 @@ def run(argv=None): max_level = 0 for file in find_files_recursively(args.files, conf): - filepath = file[2:] if file.startswith('./') else file + filepath = file.removeprefix('./') try: with open(file, newline='') as f: problems = linter.run(f, conf, filepath)