Open rhfogh opened 1 week ago
@rhfogh I will look at this
Which version of yamllint [...] is used in testing?
@rhfogh You can see this in the .pre-commit-config.yaml
file. It is currently set to version 1.35.1
, which is the current latest:
@fabcor-maxiv I am using version 1.35.1, installed locally under conda. The system yamllint (installed through Yast) is 1.22 - they do not seem to have anything newer in my repositories, but I have set the link in PyCharm to the in-conda version.
My guess is that it is simply GitHub's parser (at least the one for its GitHub Actions workflows) that does not handle the %YAML 1.2
directive. I will try to find a confirmation for this (directly from GitHub themselves if possible).
This seems to back up the theory that only a subset of YAML is supported, but I do not see it as a clear confirmation: https://github.com/orgs/community/discussions/118688
I could not find a clear confirmation from GitHub's side that the presence of the %YAML 1.2
directive is what trips up their parser, but I am quite confident that it is what triggers the issue on our side.
Could someone have a look at how the testing inteeracts with my newest PRs, e.g. mxcubecore #958, or mxcubeweb #1289?
I am getting all failures, with errors like
Invalid workflow file: .github/workflows/build_and_test.yml#L1 You have an error in your yaml syntax
This is from adding %YAML 1.2 as the first line. The thing is, this shoudl be OK sybntax for YAML 1.23 (see e.g. https://yaml.org/spec/1.2.1/), and when testing yamllint witin pycharm you clearly need to have that line (*without starting the line with a hash) to get the directive to work and enforce yaml 1.2 (and so not interpret e.g.
on
as a boolean).Some questions: Which version of yamllint and which yaml reader is used in testing? Could it be too old? Which yaml config is used in testing?
I am so unfamiliar with the testing framwork that someone else could do this a lot quicker than I could.