$ cd main folder
$ ansible-lint
WARNING Listing 1 violation(s) that are fatal
load-failure[runtimeerror]: Failed to load YAML file: .gitlab-ci.yml
.gitlab-ci.yml:1 could not determine a constructor for the tag '!reference'
in "<unicode string>", line 63, column 13
Yes, I explain: my doubt arises just from .git/ folder.
ansible-lint seems to ignore it, if I don’t run it explicitly on the folder:
# cd project_dir_with_git_folder
# ansible-lint
Passed: 0 failure(s), 0 warning(s) on 19 files. Last profile that met the validation criteria was 'production'.
# ansible-lint .git/*
WARNING Listing 1 violation(s) that are fatal
load-failure: Failed to load or parse file.
.git/pippo.yml:1
Rule Violation Summary
count tag profile rule associated tags
1 load-failure min core, unskippable
Failed: 1 failure(s), 0 warning(s) on 13 files.
Why is .git folder skipped then?
It seems that .git folder is a special folder for ansible-lint. But .gitlab-ci.yml is not a special file.
Not very important really, just to understand
Thank you very much
Kind Regards
Marco
.git is special for Git, which is explicitly supported by ansible-lint (it ignores all files ignored by Git, including Git’s own housekeeping, which is in .git).
The reason why ansible-lint explicitly supports Git is that it’s the most common VCS used for Ansible roles and collections. That doesn’t mean it supports GitHub, GitLab, Gitea etc. specific files/directories though.
(There are some tools in the Ansible ecosystem which automatically handle Git repositories differently than regular directories, and some who do not. I’ve spent some time wondering whether this is a good idea, and what’s the best way to handle this. For antsibull-changelog I made this configurable. I’m not sure that’s the best solution, but .)