Skip to content
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

YAML formatting restrictions #1997

Open
1 of 4 tasks
leobalter opened this issue Dec 15, 2018 · 7 comments
Open
1 of 4 tasks

YAML formatting restrictions #1997

leobalter opened this issue Dec 15, 2018 · 7 comments

Comments

@leobalter
Copy link
Member

leobalter commented Dec 15, 2018

We should restrict the YAML format for the test files frontmatter to improve interoperability.

Many test runners depend on quick but limited yaml parsers and it's ok to have style restrictions identified in the importing processes for Test262.

Some of them I can already tell from scratch:

  • no leading or trailing spaces from inline lists. e.g.: [ leading-space, foo, trailing-space ]
  • no leading or trailing blank lines from text blocks. e.g. the info tag cannot start with an empty line
  • lists should always be inline. Always wrapped with square brackets and comma-space divided words. e.g.:
  • no leading or trailing spaces for the block comment limiters. (See Ensure test file YAML blocks don't have a trailing space. #2018)
features:
-  - var
-  - foo
-  - bar
+  [var, foo, bar]

There are might be more items we want to identify here. We should increase the list as necessary.

cc @caitp @gsathya @psmarshall

@gsathya
Copy link
Member

gsathya commented Jan 2, 2019

Looks like JSC's parser is having trouble with the YAML as well: https://bugs.webkit.org/show_bug.cgi?id=193053

@leobalter
Copy link
Member Author

leobalter commented Jan 7, 2019

@gsathya yes, the issues we can list here might affect at least V8, JSC and SpiderMonkey. Turns out it Yaml parsers are more challenging than one can expect.


Edit: For clarification, my goal is to tackle these issues and provide a consistent format to avoid any problem when consuming test262 in other projects.

@mathiasbynens
Copy link
Member

Previously: #1817, #1821, #1868.

@gsathya
Copy link
Member

gsathya commented Jan 17, 2019

Another one: #2034

@littledan
Copy link
Member

Thanks for working on this important issue, @leobalter.

@kmiller68
Copy link
Contributor

Would it also be possible to prohibit inline value strings that span multiple lines? That seems to cause issues for JSC's YAML parser...

For example:

description: Security Throws a TypeError if start coercion detaches
  the buffer

Ideally, this would be formatted as one line or with "|"/">"

@rkirsling
Copy link
Member

Opened #2505 to address the specific issue @kmiller68 identified.

jugglinmike added a commit that referenced this issue Sep 3, 2021
Some consumers have reported difficulty parsing an uncommon YAML
construction [1] [2] [3]. Extend the linter to help ensure that
construction is not used in future contributions.

[1] #1997
[2] #2505
[3] #3171
jugglinmike added a commit that referenced this issue Sep 3, 2021
Some consumers have reported difficulty parsing an uncommon YAML
construction [1] [2] [3]. Extend the linter to help ensure that
construction is not used in future contributions.

[1] #1997
[2] #2505
[3] #3171
rwaldron pushed a commit that referenced this issue Sep 7, 2021
Some consumers have reported difficulty parsing an uncommon YAML
construction [1] [2] [3]. Extend the linter to help ensure that
construction is not used in future contributions.

[1] #1997
[2] #2505
[3] #3171
ossy-szeged added a commit to ossy-szeged/test262 that referenced this issue Jan 4, 2022
Includes key should use flow notation to be able parsed easier
as suggested in tc39#1997

Added this check to the linting script and updated tests accordingly.
rwaldron pushed a commit that referenced this issue Jan 5, 2022
Includes key should use flow notation to be able parsed easier
as suggested in #1997

Added this check to the linting script and updated tests accordingly.
ossy-szeged added a commit to ossy-szeged/test262 that referenced this issue Jan 6, 2022
The phase field must precede the type field for negative tests
to have a consistent style and be able to parse easier.
Related to the goal of tc39#1997

Added this check to the linting script and updated tests accordingly.
rwaldron pushed a commit that referenced this issue Jan 10, 2022
The phase field must precede the type field for negative tests
to have a consistent style and be able to parse easier.
Related to the goal of #1997

Added this check to the linting script and updated tests accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@mathiasbynens @littledan @leobalter @gsathya @rkirsling @kmiller68 and others