mirror of
https://github.com/adrienverge/yamllint.git
synced 2025-02-25 18:55:20 -06:00
anchors: Add missing quotes in unused anchor error message
Existing `anchors` options use quotes around the anchor name: 2:3 error found undeclared alias "unknown" (anchors) 4:3 error found duplicated anchor "dup" (anchors) Let's do the same in the newly-added option `forbid-unused-anchors`: 5:3 error found unused anchor "not used" (anchors)
This commit is contained in:
parent
f874b6607c
commit
977f4908b5
@ -159,7 +159,7 @@ def check(conf, token, prev, next, nextnext, context):
|
||||
if not info['used']:
|
||||
yield LintProblem(info['line'] + 1,
|
||||
info['column'] + 1,
|
||||
f"found unused anchor {anchor}")
|
||||
f'found unused anchor "{anchor}"')
|
||||
elif isinstance(token, yaml.AliasToken):
|
||||
context['anchors'].get(token.value, {})['used'] = True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user