Skip to content

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

@kokorin

Description

@kokorin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions