language-formatters-pre-commit-hooks icon indicating copy to clipboard operation
language-formatters-pre-commit-hooks copied to clipboard

Could not determine a constructor for the tag '!reference'

Open kokorin opened this issue 1 year ago • 0 comments
trafficstars

We changed Gitlab CI Yaml file and added !reference tag like this:

deploy-dev:
   script:
    - !reference [.deploy, script]
    - other commands

pre-commit run gives the following output:

check yaml...............................................................Failed
- hook id: check-yaml
- exit code: 1

could not determine a constructor for the tag '!reference'
  in ".gitlab-ci.yml", line 194, column 7

I found a recommendation to update ruamel version and added dependencies:

default_install_hook_types: [pre-commit, pre-push]
repos:
  # other repos removed
  - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
    rev: v2.13.0
    hooks:
      - id: pretty-format-yaml
        args: [--autofix, --indent, '2', --offset, '2', --preserve-quotes]
        stages: [commit]
        additional_dependencies:
          - 'ruamel.yaml==0.18.6'
          - 'ruamel.yaml.clib==0.2.8'

Unfortunately that didn't help

Python version 3.9.7

kokorin avatar May 28 '24 12:05 kokorin