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

Remove unstable AST testing #10462

Merged
merged 4 commits into from Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@angular/compiler": "11.2.3",
"@babel/code-frame": "7.12.13",
"@babel/parser": "7.13.4",
"@babel/parser": "7.13.9",
"@glimmer/syntax": "0.77.1",
"@iarna/toml": "2.2.5",
"@typescript-eslint/typescript-estree": "4.15.2",
Expand Down
13 changes: 6 additions & 7 deletions tests_config/run_spec.js
Expand Up @@ -47,19 +47,18 @@ const unstableTests = new Map(
})
);

// This is temporary.
// This will be removed once https://github.com/babel/babel/issues/12915 is fixed
const unstableAstTests = new Map(
[
[
"flow/function-parentheses/single.js",
(options) =>
options.parser.startsWith("babel") && options.arrowParens !== "avoid",
"json/json/propertyKey.json",
(options) => options.parser === "json-stringify",
],
[
"flow/function-parentheses/test.js",
(options) => options.parser.startsWith("babel"),
"json/json/positive-number.json",
(options) => options.parser === "json-stringify",
],
["json/json/json5.json", (options) => options.parser === "json-stringify"],
["json/json/array.json", (options) => options.parser === "json-stringify"],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In now parserExpression returns AST includes tokens so may break AST idempotency for json-stringify parser.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see tokens in ignoredProperties in clean.js. Why does that property still affect idempotence tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably ignoreProperties are ignored by messageAST, are not by idempotence tests.

https://github.com/prettier/prettier/blob/main/src/main/massage-ast.js#L13-L18

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should work, I'll take a look.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tokens was not ignored in estree-json printer.

].map((fixture) => {
const [file, isUnstable = () => true] = Array.isArray(fixture)
? fixture
Expand Down
8 changes: 7 additions & 1 deletion yarn.lock
Expand Up @@ -283,7 +283,12 @@
chalk "^2.0.0"
js-tokens "^4.0.0"

"@babel/parser@7.13.4", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.4":
"@babel/parser@7.13.9":
version "7.13.9"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.9.tgz#ca34cb95e1c2dd126863a84465ae8ef66114be99"
integrity sha512-nEUfRiARCcaVo3ny3ZQjURjHQZUo/JkEw7rLlSZy/psWGnvwXFtPcr6jb7Yb41DVW5LTe6KRq9LGleRNsg1Frw==

"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.4":
version "7.13.4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs deduplication.

resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.4.tgz#340211b0da94a351a6f10e63671fa727333d13ab"
integrity sha512-uvoOulWHhI+0+1f9L4BoozY7U5cIkZ9PgJqvb041d6vypgUmtVPG4vmGm4pSggjl8BELzvHyUeJSUyEMY6b+qA==
Expand Down Expand Up @@ -3039,6 +3044,7 @@ eslint-plugin-jest@24.1.5:

"eslint-plugin-prettier-internal-rules@link:scripts/tools/eslint-plugin-prettier-internal-rules":
version "0.0.0"
uid ""

eslint-plugin-react@7.22.0:
version "7.22.0"
Expand Down