camaraproject / QualityOnDemand

Repository to describe, develop, document and test the QualityOnDemand API family
https://wiki.camaraproject.org/x/zwOeAQ
Apache License 2.0
41 stars 59 forks source link

Megalinter: Validation failed - "truthy" acts on "on"-keyword (swagger-editor-validator.yaml) #211

Closed maxl2287 closed 1 year ago

maxl2287 commented 1 year ago

Describe the bug

I discovered a bug during a PR creation.

YAMLLINT failure ❌ Linted [YAML] files with [yamllint]: Found 1 error(s) - (1.34s) (expand for details)

✅ Linted [REPOSITORY] files with [git_diff] successfully - (0.06s) (expand for details) ✅ Linted [OPENAPI] files with [spectral] successfully - (3.54s) (expand for details)

+----SUMMARY----+------------+---------------+-------+-------+--------+--------------+ | Descriptor | Linter | Mode | Files | Fixed | Errors | Elapsed time | +---------------+------------+---------------+-------+-------+--------+--------------+ | ✅ ACTION | actionlint | list_of_files | 2 | | 0 | 0.0s | | ✅ OPENAPI | spectral | file | 1 | | 0 | 3.54s | | ✅ REPOSITORY | git_diff | project | n/a | | 0 | 0.06s | | ✅ REPOSITORY | grype | project | n/a | | 0 | 12.98s | | ✅ REPOSITORY | secretlint | project | n/a | | 0 | 1.33s | | ✅ REPOSITORY | trivy-sbom | project | n/a | | 0 | 1.59s | | ✅ REPOSITORY | trufflehog | project | n/a | | 0 | 5.29s | | ✅ XML | xmllint | list_of_files | 2 | 0 | 0 | 0.06s | | ✅ YAML | v8r | list_of_files | 6 | | 0 | 5.08s | | ❌ YAML | yamllint | list_of_files | 6 | | 1 | 1.34s | +---------------+------------+---------------+-------+-------+--------+--------------+

Why is there an error

Expected behavior Disable truthy "on" rule-validation.

on:  # yamllint disable-line rule:truthy
  pull_request:
    branches:
      - main
maxl2287 commented 1 year ago

Related issues on "yamllint": https://github.com/adrienverge/yamllint/issues/430

maxl2287 commented 1 year ago

allowed-values defines the list of truthy values which will be ignored during linting. The default is ['true', 'false'], but can be changed to any list containing: 'TRUE', 'True', 'true', 'FALSE', 'False', 'false', 'YES', 'Yes', 'yes', 'NO', 'No', 'no', 'ON', 'On', 'on', 'OFF', 'Off', 'off'.

Maybe also "on" could be put on the list of "truthy"-ignored values for keywords. source: https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.truthy