Skip to content

Commit

Permalink
test: Ignore *.html in prettier until go-template is fixed (#3067)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
max-sixty and pre-commit-ci[bot] authored Jul 25, 2023
1 parent 04b5174 commit 5bb5796
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ target/
**/dist
/web/book/book
/web/website/public

# TODO: fix the go-template issue in `.prettierrc.yaml`
**/*.html
13 changes: 7 additions & 6 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 3 additions & 3 deletions bindings/prql-js/tests/test_all.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});

Expand All @@ -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"));
Expand Down
2 changes: 1 addition & 1 deletion web/book/highlight-prql.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
4 changes: 3 additions & 1 deletion web/book/mdbook-admonish.css
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion web/book/src/reference/syntax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A summary of PRQL syntax:
| `! && == +` | [Operations](./operators.md) | <code>filter a == b + c \|\| d >= e</code> |
| `()` | [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)` |
Expand Down
2 changes: 1 addition & 1 deletion web/playground/generateBook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
16 changes: 13 additions & 3 deletions web/playground/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion web/playground/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
</React.StrictMode>,
);

// If you want to start measuring performance in your app, pass a function
Expand Down
4 changes: 2 additions & 2 deletions web/playground/src/sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function Sidebar({ library, onLoadFile }) {
{name ?? filename}
</div>
)}
</React.Fragment>
</React.Fragment>,
);
}

Expand All @@ -59,7 +59,7 @@ function Sidebar({ library, onLoadFile }) {
<h2>{section}</h2>

{fileRows}
</section>
</section>,
);
}

Expand Down
2 changes: 1 addition & 1 deletion web/playground/src/workbench/Workbench.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Workbench extends React.Component {
this.monaco.editor.setModelMarkers(
this.editor.getModel(),
"prql",
monacoErrors
monacoErrors,
);
return;
}
Expand Down
11 changes: 8 additions & 3 deletions web/playground/src/workbench/duckdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion web/website/themes/prql-theme/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down

0 comments on commit 5bb5796

Please sign in to comment.