vscode-yaml: .gitlab-ci.yml validation errors
Hi,
I’m seeing errors in the validation of .gitlab-ci.yml
files, specifically anchors, as described in https://github.com/redhat-developer/vscode-yaml/issues/60.
However, as per https://github.com/redhat-developer/vscode-yaml/issues/87, this doesn’t happen if I rename the file to .yaml
where it validates correctly.
Interestingly it does appear to be using the correct schema for validation, just not recognising the anchor is an anchor, and therefore complaining about missing attributes that would otherwise be mandatory.
Thanks.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 16
- Comments: 22 (4 by maintainers)
Not sure this is correct?
.gitlab-ci.yml
is the correct file name, it is the linter that only works if you rename it toyaml
It appears to, yes
Can we get an update to such a simple problem?
The extensions page says it uses schema store to automatically try to match up the schema using the file name you’re editing.
Having a look at the gitlab-ci schema on the schema store here it seems like this just doesn’t match up with the actual schema gitlab expects.
Changing the file to .yaml makes this lookup not match/not happen.
You can change these settings in vscode in your settings.json:
There are some open issues on gitlab for them to host their own json schema for gitlab-ci files. Basically what’s out there just gets outdated and gitlab has to make pull requests if they change the schema and the whole thing might just be too slow.
Sorry if that’s not very helpful but that’s about all I could come up with trying to solve the issue.
If you had a valid schema file for the gitlab-ci file (which maybe you could find in a PR over at the json store repo) you could put something in like:
But I can’t find a better schema file myself.