mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 21:04:17 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
f60596972c
commit
e57da9d9a1
1 changed files with 9 additions and 5 deletions
|
|
@ -65,15 +65,19 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||||
load_fn = LOAD_FNS[Key(multi=args.multi, unsafe=args.unsafe)]
|
load_fn = LOAD_FNS[Key(multi=args.multi, unsafe=args.unsafe)]
|
||||||
|
|
||||||
if args.ignore_ansible_vault:
|
if args.ignore_ansible_vault:
|
||||||
def ignore_ansible_vault(loader: ruamel.yaml.Loader,
|
def ignore_ansible_vault(
|
||||||
node: ruamel.yaml.Node) -> Any:
|
loader: ruamel.yaml.Loader,
|
||||||
|
node: ruamel.yaml.Node,
|
||||||
|
) -> Any:
|
||||||
if node.value.startswith('!vault'):
|
if node.value.startswith('!vault'):
|
||||||
node.value = node.value[1:]
|
node.value = node.value[1:]
|
||||||
return loader.construct_yaml_str(node)
|
return loader.construct_yaml_str(node)
|
||||||
|
|
||||||
ruamel.yaml.add_constructor(u'!vault',
|
ruamel.yaml.add_constructor(
|
||||||
ignore_ansible_vault,
|
'!vault',
|
||||||
constructor=ruamel.yaml.SafeConstructor)
|
ignore_ansible_vault,
|
||||||
|
constructor=ruamel.yaml.SafeConstructor,
|
||||||
|
)
|
||||||
|
|
||||||
retval = 0
|
retval = 0
|
||||||
for filename in args.filenames:
|
for filename in args.filenames:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue