mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-30 10:16:54 +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)]
|
||||
|
||||
if args.ignore_ansible_vault:
|
||||
def ignore_ansible_vault(loader: ruamel.yaml.Loader,
|
||||
node: ruamel.yaml.Node) -> Any:
|
||||
def ignore_ansible_vault(
|
||||
loader: ruamel.yaml.Loader,
|
||||
node: ruamel.yaml.Node,
|
||||
) -> Any:
|
||||
if node.value.startswith('!vault'):
|
||||
node.value = node.value[1:]
|
||||
return loader.construct_yaml_str(node)
|
||||
|
||||
ruamel.yaml.add_constructor(u'!vault',
|
||||
ignore_ansible_vault,
|
||||
constructor=ruamel.yaml.SafeConstructor)
|
||||
ruamel.yaml.add_constructor(
|
||||
'!vault',
|
||||
ignore_ansible_vault,
|
||||
constructor=ruamel.yaml.SafeConstructor,
|
||||
)
|
||||
|
||||
retval = 0
|
||||
for filename in args.filenames:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue