Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ overrides:
parser: 'liquid-html'
singleAttributePerLine: false
singleQuote: false
- files:
- '*.json5'
options:
parser: json5
# Biome has no JSON5 parser and skips these files without saying so,
# which left `verify.json` claiming a coverage it did not have. Prettier
# is what reads them now -- for syntax and layout, not to restyle them:
# `.renovaterc.json5` is written the way renovate documents it, and that
# spelling is not ours to change.
quoteProps: preserve
singleQuote: false
- files:
- '*.md'
options:
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/format/format-dockerfile.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/format/format-dockerfile
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const dockerfileFiles = await glob([
'.devcontainer/**/Dockerfile',
Expand All @@ -14,7 +14,7 @@ const dockerfileFiles = await glob([
]);

let exitCode = 0;
const scripts = [`dprint fmt ${dockerfileFiles.join(' ')}`];
const scripts = [`dprint fmt ${quote(dockerfileFiles)}`];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/format/format-js.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/format/format-js
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const jsFiles = await glob([
'**/*.js',
Expand All @@ -16,7 +16,7 @@ const jsFiles = await glob([
]);

let exitCode = 0;
const scripts = [`biome check --write ${jsFiles.join(' ')}`];
const scripts = [`biome check --write ${quote(jsFiles)}`];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
22 changes: 13 additions & 9 deletions build/tasks/format/format-json.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
* @module {type ES6Module} build/tasks/format/format-json
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const jsonFiles = await glob([
'**/*.json',
'**/*.json5',
'**/*.jsonc',
'!_site/',
'!node_modules/',
]);
const EXCLUDED = ['!_site/', '!node_modules/'];

const jsonFiles = await glob(['**/*.json', '**/*.jsonc', ...EXCLUDED]);
// Biome has no JSON5 parser. Handed one it reports the path as ignored and
// carries on with the rest, so listing `**/*.json5` beside the others read as
// coverage while being none: nothing looked at `.renovaterc.json5` at all.
// Prettier does have the parser.
const json5Files = await glob(['**/*.json5', ...EXCLUDED]);

let exitCode = 0;
const scripts = [`biome check --write ${jsonFiles.join(' ')}`];
const scripts = [
`biome check --write ${quote(jsonFiles)}`,
...(json5Files.length > 0 ? [`prettier --write ${quote(json5Files)}`] : []),
];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/format/format-liquid.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/format/format-liquid
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const LiquidFiles = await glob([
'**/*.html',
Expand All @@ -15,7 +15,7 @@ const LiquidFiles = await glob([
]);

let exitCode = 0;
const scripts = [`prettier --write ${LiquidFiles.join(' ')}`];
const scripts = [`prettier --write ${quote(LiquidFiles)}`];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
6 changes: 3 additions & 3 deletions build/tasks/format/format-md.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/format/format-md
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const markdownFiles = await glob([
'**/*.md',
Expand All @@ -24,8 +24,8 @@ const markdownFiles = await glob([

let exitCode = 0;
const scripts = [
`prettier --write ${markdownFiles.join(' ')}`,
`markdownlint-cli2 --fix ${markdownFiles.join(' ')}`,
`prettier --write ${quote(markdownFiles)}`,
`markdownlint-cli2 --fix ${quote(markdownFiles)}`,
];

for (const element of scripts) {
Expand Down
6 changes: 3 additions & 3 deletions build/tasks/format/format-scss.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* @module {type ES6Module} build/tasks/format/format-scss
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const scssFiles = await glob(['**/*.scss', '!_site/', '!node_modules/']);

let exitCode = 0;
const scripts = [
`prettier --write ${scssFiles.join(' ')}`,
`stylelint --fix ${scssFiles.join(' ')}`,
`prettier --write ${quote(scssFiles)}`,
`stylelint --fix ${quote(scssFiles)}`,
];

for (const element of scripts) {
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/format/format-svg.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* @module {type ES6Module} build/tasks/format/format-svg
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const svgFiles = await glob(['**/*.svg', '!_site/', '!node_modules/']);

let exitCode = 0;
const scripts = [`prettier --write ${svgFiles.join(' ')}`];
const scripts = [`prettier --write ${quote(svgFiles)}`];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/format/format-toml.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* @module {type ES6Module} build/tasks/format/format-toml
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const tomlFiles = await glob(['**/*.toml', '!_site/', '!node_modules/']);

let exitCode = 0;
const scripts = [`dprint fmt ${tomlFiles.join(' ')}`];
const scripts = [`dprint fmt ${quote(tomlFiles)}`];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/format/format-ts.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/format/format-ts
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const tsFiles = await glob([
'**/*.ts',
Expand All @@ -15,7 +15,7 @@ const tsFiles = await glob([
]);

let exitCode = 0;
const scripts = [`biome check --write ${tsFiles.join(' ')}`];
const scripts = [`biome check --write ${quote(tsFiles)}`];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/format/format-yaml.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/format/format-yaml
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const yamlFiles = await glob([
'**/*.yml',
Expand All @@ -15,7 +15,7 @@ const yamlFiles = await glob([
]);

let exitCode = 0;
const scripts = [`prettier --write ${yamlFiles.join(' ')}`];
const scripts = [`prettier --write ${quote(yamlFiles)}`];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/verify/verify-dockerfile.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/verify/verify-dockerfile
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const dockerfileFiles = await glob([
'.devcontainer/**/Dockerfile',
Expand All @@ -14,7 +14,7 @@ const dockerfileFiles = await glob([
]);

let exitCode = 0;
const scripts = [`dprint check ${dockerfileFiles.join(' ')}`];
const scripts = [`dprint check ${quote(dockerfileFiles)}`];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/verify/verify-html-valid-for-vnu.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/verify/verify-html-valid-for-vnu
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';
import vnu from 'vnu-jar';

const htmlFiles = await glob(['_site/**/*.html', '!node_modules/']);
Expand All @@ -19,7 +19,7 @@ if (htmlFiles.length === 0) {
}

let exitCode = 0;
const scripts = [`java -jar ${vnu} ${htmlFiles.join(' ')}`];
const scripts = [`java -jar ${quote(vnu)} ${quote(htmlFiles)}`];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/verify/verify-js.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/verify/verify-js
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const jsFiles = await glob([
'**/*.js',
Expand All @@ -16,7 +16,7 @@ const jsFiles = await glob([
]);

let exitCode = 0;
const scripts = [`biome check ${jsFiles.join(' ')}`];
const scripts = [`biome check ${quote(jsFiles)}`];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
22 changes: 13 additions & 9 deletions build/tasks/verify/verify-json.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
* @module {type ES6Module} build/tasks/verify/verify-json
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const jsonFiles = await glob([
'**/*.json',
'**/*.json5',
'**/*.jsonc',
'!_site/',
'!node_modules/',
]);
const EXCLUDED = ['!_site/', '!node_modules/'];

const jsonFiles = await glob(['**/*.json', '**/*.jsonc', ...EXCLUDED]);
// Biome has no JSON5 parser. Handed one it reports the path as ignored and
// carries on with the rest, so listing `**/*.json5` beside the others read as
// coverage while being none: nothing looked at `.renovaterc.json5` at all.
// Prettier does have the parser.
const json5Files = await glob(['**/*.json5', ...EXCLUDED]);

let exitCode = 0;
const scripts = [`biome check ${jsonFiles.join(' ')}`];
const scripts = [
`biome check ${quote(jsonFiles)}`,
...(json5Files.length > 0 ? [`prettier --check ${quote(json5Files)}`] : []),
];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/verify/verify-liquid.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/verify/verify-liquid
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const liquidFiles = await glob([
'**/*.html',
Expand All @@ -15,7 +15,7 @@ const liquidFiles = await glob([
]);

let exitCode = 0;
const scripts = [`prettier --check ${liquidFiles.join(' ')}`];
const scripts = [`prettier --check ${quote(liquidFiles)}`];

for (const element of scripts) {
exitCode = await exec(element);
Expand Down
8 changes: 4 additions & 4 deletions build/tasks/verify/verify-md.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/verify/verify-md
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const markdownFiles = await glob([
'**/*.md',
Expand All @@ -24,9 +24,9 @@ const markdownFiles = await glob([

let exitCode = 0;
const scripts = [
`prettier --check ${markdownFiles.join(' ')}`,
`markdownlint-cli2 ${markdownFiles.join(' ')}`,
`remark -f --silently-ignore ${markdownFiles.join(' ')}`,
`prettier --check ${quote(markdownFiles)}`,
`markdownlint-cli2 ${quote(markdownFiles)}`,
`remark -f --silently-ignore ${quote(markdownFiles)}`,
];

for (const element of scripts) {
Expand Down
6 changes: 3 additions & 3 deletions build/tasks/verify/verify-scss.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* @module {type ES6Module} build/tasks/verify/verify-scss
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

const scssFiles = await glob(['**/*.scss', '!_site/', '!node_modules/']);

let exitCode = 0;
const scripts = [
`prettier --check ${scssFiles.join(' ')}`,
`stylelint ${scssFiles.join(' ')}`,
`prettier --check ${quote(scssFiles)}`,
`stylelint ${quote(scssFiles)}`,
];

for (const element of scripts) {
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/verify/verify-spelling.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @module {type ES6Module} build/tasks/verify/verify-spelling
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';

// Comments and template prose are read as often as the documentation is, and
// cspell's `en` dictionary is the American one, so this is also what holds the
Expand All @@ -30,4 +30,4 @@ const files = await glob([
'!collections/_pages/vision.md',
]);

process.exitCode = await exec(`cspell lint ${files.join(' ')}`);
process.exitCode = await exec(`cspell lint ${quote(files)}`);
6 changes: 3 additions & 3 deletions build/tasks/verify/verify-svg.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* @module {type ES6Module} build/tasks/verify/verify-svg
*/

import { exec, glob } from '@openinf/portal/build/utils';
import { exec, glob, quote } from '@openinf/portal/build/utils';
import vnu from 'vnu-jar';

const svgFiles = await glob(['**/*.svg', '!_site/', '!node_modules/']);

let exitCode = 0;
const scripts = [
`prettier --check ${svgFiles.join(' ')}`,
`java -jar ${vnu} --svg ${svgFiles.join(' ')}`,
`prettier --check ${quote(svgFiles)}`,
`java -jar ${quote(vnu)} --svg ${quote(svgFiles)}`,
];

for (const element of scripts) {
Expand Down
Loading
Loading