-
Notifications
You must be signed in to change notification settings - Fork 281
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
truthy: Adapt forbidden values based on YAML version #650
Conversation
1f79d07
to
0765b0a
Compare
@perlpunk today I attended a great talk in Brussels which said there were 22 values (not 18), so I updated the commit message: -Specification of YAML ≤ 1.1 has 18 boolean values:
+Specification of YAML ≤ 1.1 has 22 boolean values: Notes: By the way, I read that between 1.1 and 1.2 "the merge |
@adrienverge thanks very much! Yeah, I think the non-standard behaviour of PyYAML makes it a bit more difficult. Regarding For my YAML::PP library I made an option So I don't have a clear idea here yet how a linter/formatter config option could look like... The so called tag repository is kind of hidden, yeah. You can find it in the 1.1 spec under YAML tag repository. |
...and I just realized that I forgot |
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
@perlpunk thank you! I'll bookmark https://perlpunk.github.io/yaml-test-schema/schemas.html as it's very handy (and I'm glad you could detect a missing entry in the test list thanks to my message :)) I agree that prepending explicit tags like Anyway, I believe the change of this pull request is a good move so I'll merge it. |
0765b0a
to
3b6a3df
Compare
Also, like I said, you can use the data https://github.com/perlpunk/yaml-test-schema/tree/master/data for your test suite. |
Specification of YAML ≤ 1.1 has 22 boolean values:
Whereas YAML 1.2 spec recognizes only 6 1:
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:
default-yaml-spec-version: 1.2
,Solves: #587
Related to: #559 #540 #430 #344 #247 #232 #158
Footnotes
https://yaml.org/spec/1.2.2/#1032-tag-resolution ↩
https://yaml.org/spec/1.2.2/ext/changes/#changes-in-version-12-revision-120-2009-07-21 ↩