From 5bb579685880e0975852457530e548b651630c43 Mon Sep 17 00:00:00 2001 From: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> Date: Tue, 25 Jul 2023 12:31:42 -0700 Subject: [PATCH] test: Ignore `*.html` in prettier until go-template is fixed (#3067) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .prettierignore | 3 +++ .prettierrc.yaml | 13 +++++++------ bindings/prql-js/tests/test_all.js | 6 +++--- web/book/highlight-prql.js | 2 +- web/book/mdbook-admonish.css | 4 +++- web/book/src/reference/syntax/README.md | 2 +- web/playground/generateBook.js | 2 +- web/playground/src/index.css | 16 +++++++++++++--- web/playground/src/index.js | 2 +- web/playground/src/sidebar/Sidebar.js | 4 ++-- web/playground/src/workbench/Workbench.js | 2 +- web/playground/src/workbench/duckdb.js | 11 ++++++++--- web/website/themes/prql-theme/static/style.css | 4 +++- 13 files changed, 47 insertions(+), 24 deletions(-) diff --git a/.prettierignore b/.prettierignore index e8fe196147ea..42c6b1d1e9ea 100644 --- a/.prettierignore +++ b/.prettierignore @@ -15,3 +15,6 @@ target/ **/dist /web/book/book /web/website/public + +# TODO: fix the go-template issue in `.prettierrc.yaml` +**/*.html diff --git a/.prettierrc.yaml b/.prettierrc.yaml index 47fe6308869c..d4b3605a74b1 100644 --- a/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -1,7 +1,8 @@ proseWrap: always -overrides: - # https://github.com/NiklasPor/prettier-plugin-go-template - - files: - - "*.html" - options: - parser: "go-template" +# TODO: fix +# overrides: +# # https://github.com/NiklasPor/prettier-plugin-go-template +# - files: +# - "*.html" +# options: +# parser: "go-template" diff --git a/bindings/prql-js/tests/test_all.js b/bindings/prql-js/tests/test_all.js index 0d41f340403a..786dc181b7b2 100644 --- a/bindings/prql-js/tests/test_all.js +++ b/bindings/prql-js/tests/test_all.js @@ -29,13 +29,13 @@ describe("prql-js", () => { const sql = prql.compile(employee_prql); assert( sql.trim().toLowerCase().startsWith("with") || - sql.trim().toLowerCase().startsWith("select") + sql.trim().toLowerCase().startsWith("select"), ); }); it("should throw an error on invalid prql", () => { expect(() => - prql.compile("Mississippi has four Ss and four Is.") + prql.compile("Mississippi has four Ss and four Is."), ).to.throw("Error"); }); @@ -57,7 +57,7 @@ describe("prql-js", () => { const res = prql.compile( "prql target:sql.sqlite\nfrom a | take 10", - opts + opts, ); assert(res.includes("SELECT TOP (10) * FROM a")); assert(res.includes("target:sql.mssql")); diff --git a/web/book/highlight-prql.js b/web/book/highlight-prql.js index 642690c5f4be..a1d200d29c74 100644 --- a/web/book/highlight-prql.js +++ b/web/book/highlight-prql.js @@ -211,5 +211,5 @@ hljs.registerLanguage("prql", formatting); // invocation, which tags unknown-language blocks with CSS classes but doesn't // highlight them. Array.from(document.querySelectorAll("code.language-prql")).forEach((a) => - hljs.highlightElement(a) + hljs.highlightElement(a), ); diff --git a/web/book/mdbook-admonish.css b/web/book/mdbook-admonish.css index 0616dfb86683..98d4a87c7cf1 100644 --- a/web/book/mdbook-admonish.css +++ b/web/book/mdbook-admonish.css @@ -25,7 +25,9 @@ border: 0 solid black; border-inline-start-width: 0.4rem; border-radius: 0.2rem; - box-shadow: 0 0.2rem 1rem rgba(0, 0, 0, 0.05), 0 0 0.1rem rgba(0, 0, 0, 0.1); + box-shadow: + 0 0.2rem 1rem rgba(0, 0, 0, 0.05), + 0 0 0.1rem rgba(0, 0, 0, 0.1); } @media print { :is(.admonition) { diff --git a/web/book/src/reference/syntax/README.md b/web/book/src/reference/syntax/README.md index 0614cca80a91..89bbdb825a91 100644 --- a/web/book/src/reference/syntax/README.md +++ b/web/book/src/reference/syntax/README.md @@ -18,7 +18,7 @@ A summary of PRQL syntax: | `! && == +` | [Operations](./operators.md) | filter a == b + c \|\| d >= e | | `()` | [Parentheses](./operators.md#parentheses) | `derive celsius = (fahrenheit - 32) / 1.8` | | `''`, `""` | [Strings](./literals.md#strings) | `derive name = 'Mary'` | -| `` ` ` `` | [Quoted identifiers](./keywords.md#quoting) | `` select `first name` `` | +| `` ` ` `` | [Quoted identifiers](./keywords.md#quoting) | ``select `first name` `` | | `#` | [Comments](./comments.md) | `# A comment` | | `@` | [Dates & times](./literals.md#date-and-time) | `@2021-01-01` | | `==` | [Self-equality in `join`](../stdlib/transforms/join.md#self-equality-operator) | `join s=salaries (==id)` | diff --git a/web/playground/generateBook.js b/web/playground/generateBook.js index c127926b10c9..2c83903c32b1 100644 --- a/web/playground/generateBook.js +++ b/web/playground/generateBook.js @@ -98,7 +98,7 @@ function getSnippets(content, file) { const snippets = isFile(filePath) ? getSnippets( (await readFile(filePath)).toString(), - basename(filePath).replace(/\..+/g, "").trim() + basename(filePath).replace(/\..+/g, "").trim(), ) : []; if (!snippets.length && isFile(filePath)) { diff --git a/web/playground/src/index.css b/web/playground/src/index.css index 0b0c63187b6f..c3fef19ee5dc 100644 --- a/web/playground/src/index.css +++ b/web/playground/src/index.css @@ -20,12 +20,22 @@ body { font-weight: bold; font-style: normal; font-display: swap; - src: local(""), + src: + local(""), url("https://prql-lang.org/fonts/inter-extra-bold.woff2") format("woff2"), url("https://prql-lang.org/fonts/inter-extra-bold.woff") format("woff"); } h1 { - font-family: "InterExtraBold", -apple-system, BlinkMacSystemFont, "Segoe UI", - Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-family: + "InterExtraBold", + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + Roboto, + Oxygen-Sans, + Ubuntu, + Cantarell, + "Helvetica Neue", + sans-serif; } diff --git a/web/playground/src/index.js b/web/playground/src/index.js index 766c598d0fb7..d62a6a4e3afc 100644 --- a/web/playground/src/index.js +++ b/web/playground/src/index.js @@ -9,7 +9,7 @@ const root = ReactDOM.createRoot(document.getElementById("root")); root.render( - + , ); // If you want to start measuring performance in your app, pass a function diff --git a/web/playground/src/sidebar/Sidebar.js b/web/playground/src/sidebar/Sidebar.js index e3e1d0cdd694..1f86d1011c54 100644 --- a/web/playground/src/sidebar/Sidebar.js +++ b/web/playground/src/sidebar/Sidebar.js @@ -50,7 +50,7 @@ function Sidebar({ library, onLoadFile }) { {name ?? filename} )} - + , ); } @@ -59,7 +59,7 @@ function Sidebar({ library, onLoadFile }) {

{section}

{fileRows} - + , ); } diff --git a/web/playground/src/workbench/Workbench.js b/web/playground/src/workbench/Workbench.js index f7ba630375a6..9394631e886a 100644 --- a/web/playground/src/workbench/Workbench.js +++ b/web/playground/src/workbench/Workbench.js @@ -79,7 +79,7 @@ class Workbench extends React.Component { this.monaco.editor.setModelMarkers( this.editor.getModel(), "prql", - monacoErrors + monacoErrors, ); return; } diff --git a/web/playground/src/workbench/duckdb.js b/web/playground/src/workbench/duckdb.js index 43d083f14c9b..faba10521ecc 100644 --- a/web/playground/src/workbench/duckdb.js +++ b/web/playground/src/workbench/duckdb.js @@ -9,7 +9,7 @@ export async function init() { const worker_url = URL.createObjectURL( new Blob([`importScripts("${bundle.mainWorker}");`], { type: "text/javascript", - }) + }), ); // Instantiate the asynchronous version of DuckDB-wasm @@ -44,8 +44,13 @@ async function registerChinook(db) { await Promise.all( CHINOOK_TABLES.map((table) => - db.registerFileURL(`${table}.csv`, `${baseUrl}/${table}.csv`, http, false) - ) + db.registerFileURL( + `${table}.csv`, + `${baseUrl}/${table}.csv`, + http, + false, + ), + ), ); const c = await db.connect(); diff --git a/web/website/themes/prql-theme/static/style.css b/web/website/themes/prql-theme/static/style.css index 77643a7f39a2..0cfdfda12826 100644 --- a/web/website/themes/prql-theme/static/style.css +++ b/web/website/themes/prql-theme/static/style.css @@ -4,7 +4,9 @@ font-weight: 800; font-style: normal; font-display: swap; - src: local(""), url("../fonts/inter-extra-bold.woff2") format("woff2"), + src: + local(""), + url("../fonts/inter-extra-bold.woff2") format("woff2"), url("../fonts/inter-extra-bold.woff") format("woff"); }