You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is a .yamllint.yaml at the base of the git repo, with ignore-from-file pointing to .gitignore, yamllint stops working in subdirectories. It will pickup the .yamllint.yaml file in a higher level directory, but then tries to find .gitignore in the current folder. This causes it to fail with FileNotFoundError: [Errno 2] No such file or directory: '.gitignore' .
Making this extra annoying is that editor plugins like flycheck, that use yamllint, tend to use the directory where the file is located as the working dir. So having ignore-from-file in your project level .yamllint.yaml breaks in-editor linting.
The text was updated successfully, but these errors were encountered:
Yamllint doesn't handle Git repos differently than regular directories: if ignore-from-file points to a relative file, it will be searched from the current working directory. Looking for the ignore file in special locations (e.g. looking for a Git repo root in parent directories) would change current behavior and might annoy some users.
I suggest configuring flycheck to work like most Unix tools (if possible of course). Or maybe use an absolute path in ignore-from-file?
It's not really git related. Imho it does not make sense use the .yamllint.yaml that is in a parent directory and then fail because it can't find the ignore-from-file that is in that same folder.
Either don't use the .yamllint.yaml from a parent directory, or also find the files the .yamllint.yaml points to with a relative path. In the latter case the relative path should be relative to the .yamllint.yaml that is pointing to it.
In the current implementation, yamllint breaks when you go into a child folder.
If there is a
.yamllint.yaml
at the base of the git repo, withignore-from-file
pointing to .gitignore, yamllint stops working in subdirectories. It will pickup the .yamllint.yaml file in a higher level directory, but then tries to find .gitignore in the current folder. This causes it to fail withFileNotFoundError: [Errno 2] No such file or directory: '.gitignore'
.Making this extra annoying is that editor plugins like flycheck, that use yamllint, tend to use the directory where the file is located as the working dir. So having
ignore-from-file
in your project level.yamllint.yaml
breaks in-editor linting.The text was updated successfully, but these errors were encountered: