-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive: interpreting GitHub actions "on:" as a truthy value #430
Comments
Before opening a new issue:
|
Ha you're right, I guess it didn't even occur to me that an After reviewing all the issues and docs linked, I think the one-line disable is the most desirable. on: # yamllint disable-line rule:truthy I wish that Is it possible to extend a |
I'm running into this problem as well. Has anyone tried to see if github actions accepts using
Update: I've tried and it seems to work fine. |
In response to message (deleted in the meantime by its author named "Error 404"):
As already stated, this issue is a multi-duplicate, and the described behavior is not a false positive. Again, the option |
I think many people are not aware that |
Interesting. I wonder how GitHub processes it internally. I've heard that they are using a custom YAML parser which ignores many parts of the YAML standard |
Why? Making yamllint happy. It complains about it being a truthy value which is correct. See this issue as an example: <adrienverge/yamllint#430>
Currently all the github actions return warnings because the "on" keyword in the yaml files are being interpreted as a "truthy" value by yamllint. To ignore this behavior I added a rule which ignores the "on". See adrienverge/yamllint#430. Signed-off-by: Gabriel Goller <gabriel.goller@acs.it>
Currently all the github actions return warnings because the "on" keyword in the yaml files are being interpreted as a "truthy" value by yamllint. To ignore this behavior I added a rule which ignores the "on". See adrienverge/yamllint#430. Signed-off-by: Gabriel Goller <gabriel.goller@acs.it> Signed-off-by: Gabriel Goller <gabriel.goller@acs.it> Co-authored-by: Gabriel Goller <gabriel.goller@acs.it>
True. |
@adrienverge I wouldn't make the 1.2 behaviour the default. That could break too much I think. edit: but that's of course something you can decide better. I am currently also thinking about how this could be configured in yamltidy, and I'm leaning towards a |
That's cool!!
This certainly is a good idea. In the yamllint case, it could be a configurable option in |
Specification of YAML ≤ 1.1 has 18 boolean values: true | True | TRUE | false | False | FALSE yes | Yes | YES | no | No | NO on | On | ON | off | Off | OFF Whereas YAML 1.2 spec recognizes only 6: true | True | TRUE | false | False | FALSE For documents that explicit state their YAML spec version at the top of the document, let's adapt the list of forbidden values. In the future, we should: - implement a configuration option to declare the default YAML spec version, e.g. `default-yaml-spec-version: 1.2`, - consider making 1.2 the default in a future release (this would be a slight breaking change, but yamllint always tried to be 1.2-compatible). - consider adapting yamllint to other 1.1 vs. 1.2 differences [^2]. Solves: #587 Related to: #559 #540 #430 #344 #247 #232 #158 [^1]: https://yaml.org/spec/1.2.2/#1032-tag-resolution [^2]: https://yaml.org/spec/1.2.2/ext/changes/#changes-in-version-12-revision-120-2009-07-21
Specification of YAML ≤ 1.1 has 18 boolean values: true | True | TRUE | false | False | FALSE yes | Yes | YES | no | No | NO on | On | ON | off | Off | OFF Whereas YAML 1.2 spec recognizes only 6 [^1]: true | True | TRUE | false | False | FALSE For documents that explicit state their YAML spec version at the top of the document, let's adapt the list of forbidden values. In the future, we should: - implement a configuration option to declare the default YAML spec version, e.g. `default-yaml-spec-version: 1.2`, - consider making 1.2 the default in a future release (this would be a slight breaking change, but yamllint always tried to be 1.2-compatible). - consider adapting yamllint to other 1.1 vs. 1.2 differences [^2]. Solves: #587 Related to: #559 #540 #430 #344 #247 #232 #158 [^1]: https://yaml.org/spec/1.2.2/#1032-tag-resolution [^2]: https://yaml.org/spec/1.2.2/ext/changes/#changes-in-version-12-revision-120-2009-07-21
Specification of YAML ≤ 1.1 has 22 boolean values: y | Y | n | N yes | Yes | YES | no | No | NO true | True | TRUE | false | False | FALSE on | On | ON | off | Off | OFF Whereas YAML 1.2 spec recognizes only 6 [^1]: true | True | TRUE | false | False | FALSE For documents that explicit state their YAML spec version at the top of the document, let's adapt the list of forbidden values. In the future, we should: - implement a configuration option to declare the default YAML spec version, e.g. `default-yaml-spec-version: 1.2`, - consider making 1.2 the default in a future release (this would be a slight breaking change, but yamllint always tried to be 1.2-compatible). - consider adapting yamllint to other 1.1 vs. 1.2 differences [^2]. Solves: #587 Related to: #559 #540 #430 #344 #247 #232 #158 [^1]: https://yaml.org/spec/1.2.2/#1032-tag-resolution [^2]: https://yaml.org/spec/1.2.2/ext/changes/#changes-in-version-12-revision-120-2009-07-21
Specification of YAML ≤ 1.1 has 22 boolean values: y | Y | n | N yes | Yes | YES | no | No | NO true | True | TRUE | false | False | FALSE on | On | ON | off | Off | OFF Whereas YAML 1.2 spec recognizes only 6 [^1]: true | True | TRUE | false | False | FALSE For documents that explicit state their YAML spec version at the top of the document, let's adapt the list of forbidden values. In the future, we should: - implement a configuration option to declare the default YAML spec version, e.g. `default-yaml-spec-version: 1.2`, - consider making 1.2 the default in a future release (this would be a slight breaking change, but yamllint always tried to be 1.2-compatible). - consider adapting yamllint to other 1.1 vs. 1.2 differences [^2]. Solves: #587 Related to: #559 #540 #430 #344 #247 #232 #158 [^1]: https://yaml.org/spec/1.2.2/#1032-tag-resolution [^2]: https://yaml.org/spec/1.2.2/ext/changes/#changes-in-version-12-revision-120-2009-07-21
Specification of YAML ≤ 1.1 has 22 boolean values: y | Y | n | N yes | Yes | YES | no | No | NO true | True | TRUE | false | False | FALSE on | On | ON | off | Off | OFF Whereas YAML 1.2 spec recognizes only 6 [^1]: true | True | TRUE | false | False | FALSE For documents that explicit state their YAML spec version at the top of the document, let's adapt the list of forbidden values. In the future, we should: - implement a configuration option to declare the default YAML spec version, e.g. `default-yaml-spec-version: 1.2`, - consider making 1.2 the default in a future release (this would be a slight breaking change, but yamllint always tried to be 1.2-compatible). - consider adapting yamllint to other 1.1 vs. 1.2 differences [^2]. Solves: #587 Related to: #559 #540 #430 #344 #247 #232 #158 [^1]: https://yaml.org/spec/1.2.2/#1032-tag-resolution [^2]: https://yaml.org/spec/1.2.2/ext/changes/#changes-in-version-12-revision-120-2009-07-21
False positive in "on:" adrienverge/yamllint#430 (comment)
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
Here is part of a GitHub action workflow
foo.yml
:Currently,
yamllint==v1.26.3
invoked viapre-commit==v4.0.1
with--strict
raises the following warning:I believe yamllint's perception of
on:
being a truthy value is incorrect, and thus is a false positive warning.For now, I am using this workaround:
The text was updated successfully, but these errors were encountered: