Skip to content

extends should be evaluated relative to the config file, not the current working directory #778

@btrautmann

Description

@btrautmann

I created this issue originally, but upon doing more investigation I realized this is really just an issue (or oddity) with yamllint itself.

Basically, all the tooling I'm used to that has an "extends" feature in yaml files allows relative paths to be evaluated relative to the file itself, not the current working directory.

In my setup, we have:

./.yamllint and ./.github/.yamllint, where the latter extends the former via extends: ../.yamllint

However, running yamllint -c .github/.yamllint .github/ from root and yamllint -c .yamllint . yield different results. When run from the root (the default behavior on Github Actions), an error is thrown (the one indicated in the above ticket). When run from the .github directory, the command succeeds.

I searched prior issues and saw a couple that touched on relative paths, but I don't think any of them specifically touched on this issue (which was surprising). Please feel free to point me to any issues I may have missed.

Thanks!

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