Skip to content

The !ENV tag is not usable in yaml #281

@thclark

Description

@thclark

I'm not sure if this is specific to mkdocs, or part of teh yaml spec, but there seems to be a possibility for adding special tags in yaml for mkdocs configuration - particularly the !ENV tag.

When pre-commit is run we get the following error:

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

could not determine a constructor for the tag '!ENV'
  in "mkdocs.yml", line 3, column 11

Example yml:

site_name: Django Guardian
site_description: django-guardian - per object permissions for Django - Django Guardian
site_url: !ENV READTHEDOCS_CANONICAL_URL
repo_url: https://github.com/django-guardian/django-guardian

Our pre-commit config:

  - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
    rev: 'v2.15.0'
    hooks:
      - id: pretty-format-yaml
        args: [--autofix, --indent, '2']

It would be helpful if we could define a custom tag (or if this one were incorporated).

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