Skip to content

Ignoring file that is a broken symbolic link produces "[Errno 2] No such file or directory"  #399

@thomasdstewart

Description

@thomasdstewart

Hi,

When running yamllint on a directory of files if a file is a broken symbolic link it produces "[Errno 2] No such file or directory" even if the file is set to be ignored. I was able to reproduce using latest yamllint[0] along with a small test environment[1] and by running "yamllint ." to show the error[2].

Kind Regards
Tom

[0]

$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install yamllint
$ yamllint --version
yamllint 1.26.2
$

[1]

$ mkdir test; cd test
$ ln -s not_there ignore_file.yaml
$ ls -l ignore_file.yaml 
lrwxrwxrwx 1 thomas thomas 9 Aug  5 10:45 ignore_file.yaml -> not_there
$ cat .yamllint 
---
extends: default

ignore: |
  ignore_file.yaml
$

[2]

$ yamllint .
[Errno 2] No such file or directory: './ignore_file.yaml'
$

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