Skip to content

Commit d8f1d7c

Browse files
style: Apply ruff/refurb rule FURB188
FURB188 Prefer `str.removeprefix()` over conditionally replacing with slice.
1 parent 2f87db8 commit d8f1d7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

yamllint/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def run(argv=None):
217217
max_level = 0
218218

219219
for file in find_files_recursively(args.files, conf):
220-
filepath = file[2:] if file.startswith('./') else file
220+
filepath = file.removeprefix('./')
221221
try:
222222
with open(file, newline='') as f:
223223
problems = linter.run(f, conf, filepath)

0 commit comments

Comments
 (0)