Skip to content

Commit

Permalink
chore(challenge): refine reports (#796)
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos authored Nov 19, 2023
1 parent 2e863bb commit 708ce96
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 329 deletions.
6 changes: 5 additions & 1 deletion crates/biome_formatter_test/src/diff_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ impl DiffReport {
"arrows-bind",
"async-do-expressions",
"async-do-expressions",
"babylon-extensions",
"decimal",
"do-expressions",
"export-default-from",
"function-bind",
"module-blocks",
"module-block",
"partial-application",
"pipeline",
"record",
Expand All @@ -122,6 +123,7 @@ impl DiffReport {
"v8intrinsic",
"v8_intrinsic",
"bind-expressions",
"js/objects/expression.js",
"destructuring-private-fields",
"/do/",
"export-extension",
Expand All @@ -134,6 +136,8 @@ impl DiffReport {
"js/range/issue-7082.js",
"js/template-literals/css-prop.js",
"js/template-literals/styled",
"js/last-argument-expansion/embed.js",
"typescript/as/as-const-embedded.ts",
];

patterns.iter().any(|pattern| file_name.contains(pattern))
Expand Down
166 changes: 2 additions & 164 deletions crates/biome_js_formatter/report.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Overall Metrics

**Average compatibility**: 95.39
**Average compatibility**: 95.62

<details>
<summary>Definition</summary>

$$average = \frac\{\sum_{file}^\{files}compatibility_\{file}}\{files}$$
</details>

**Compatible lines**: 95.85
**Compatible lines**: 96.05
<details>
<summary>Definition</summary>

Expand Down Expand Up @@ -3526,34 +3526,6 @@
**Prettier Similarity**: 100.00%


# js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js
```diff
-const m = module {
+const m = module;
+{
await using foo = bar();
-};
+}

```

**Prettier Similarity**: 25.00%


# js/explicit-resource-management/valid-module-block-top-level-using-binding.js
```diff
-module {
+module;
+{
using foo = bar();
-};
+}

```

**Prettier Similarity**: 25.00%


# js/explicit-resource-management/valid-using-as-identifier-computed-member.js

**Prettier Similarity**: 100.00%
Expand Down Expand Up @@ -4589,58 +4561,6 @@
**Prettier Similarity**: 100.00%


# js/last-argument-expansion/embed.js
```diff
-foo(/* HTML */ `<!-- bar1 -->
- bar
- <!-- bar2 -->`);
-foo(/* HTML */ `
- <!-- bar1 -->
- bar
- <!-- bar2 -->
-`);
-foo(/* HTML */ `<div>
- <p>bar</p>
- foo
- </div>`);
-foo(/* HTML */ `
- <div>
- <p>bar</p>
- foo
- </div>
-`);
-foo(/* GraphQL */ `
- query {
- foo {
- bar
- }
- }
-`);
-foo(/* ... */ css`
- color: magenta;
-`);
-const a = (b) => /* HTML */ `<!-- bar1 -->
- bar
- <!-- bar2 -->`;
-const c = (b) => /* HTML */ `
- <!-- bar1 -->
- bar
- <!-- bar2 -->
-`;
+foo(/* HTML */ `<!-- bar1 --> bar <!-- bar2 -->`);
+foo(/* HTML */ ` <!-- bar1 --> bar <!-- bar2 --> `);
+foo(/* HTML */ `<div><p>bar</p>foo</div>`);
+foo(/* HTML */ ` <div><p>bar</p>foo</div> `);
+foo(/* GraphQL */ `query { foo { bar } }`);
+foo(/* ... */ css`color:magenta`);
+const a = (b) => /* HTML */ `<!-- bar1 --> bar <!-- bar2 -->`;
+const c = (b) => /* HTML */ ` <!-- bar1 --> bar <!-- bar2 --> `;

```

**Prettier Similarity**: 0.00%


# js/last-argument-expansion/empty-lines.js

**Prettier Similarity**: 100.00%
Expand Down Expand Up @@ -4967,26 +4887,6 @@
**Prettier Similarity**: 100.00%


# js/no-semi-babylon-extensions/no-semi.js
```diff
a;
-::b.c;
+::b.c

class A {
a = b;
in;
c;

a = b;
instanceof() {}
}

```

**Prettier Similarity**: 90.91%


# js/no-semi/class.js

**Prettier Similarity**: 100.00%
Expand Down Expand Up @@ -5109,43 +5009,6 @@
**Prettier Similarity**: 100.00%


# js/objects/expression.js
```diff
() => ({})``;
({})``;
a = () => ({}).x;
({}) && a, b;
-({})::b, 0;
-({})::b()``[""].c++ && 0 ? 0 : 0, 0;
+({}
+::b, 0)
+({}
+::b()``[''].c++ && 0 ? 0 : 0, 0)
({})(), 0;
({} = 0);
({} = 0), 1;

const a1 = {
someKey: (shortName, shortName),
};

const a2 = {
someKey:
(longLongLongLongLongLongLongLongLongLongLongLongLongLongName, shortName),
};

const a3 = {
someKey:
(longLongLongLongLongLongLongLongLongLongLongLongLongLongName,
longLongLongLongLongLongLongLongLongLongLongLongLongLongName,
longLongLongLongLongLongLongLongLongLongLongLongLongLongName),
};

```

**Prettier Similarity**: 85.19%


# js/objects/getter-setter.js

**Prettier Similarity**: 100.00%
Expand Down Expand Up @@ -7960,31 +7823,6 @@
**Prettier Similarity**: 100.00%


# typescript/as/as-const-embedded.ts
```diff
const GQL_QUERY_WITH_CONST = /* GraphQL */ `
- query S {
- shop
- }
+ query S { shop }
` as const;

const HTML_WITH_CONST = /* HTML */ `
- <div>
- <h1>foo</h1>
- <p>foo</p>
- </div>
+<div>
+<h1>foo</h1>
+ <p>foo</p>
+</div>
` as const;

```

**Prettier Similarity**: 41.67%


# typescript/as/as.ts

**Prettier Similarity**: 100.00%
Expand Down
Loading

0 comments on commit 708ce96

Please sign in to comment.