5 Commits

Author SHA1 Message Date
20e5da0d54 Teach fixup.sh to use biome 2026-01-01 17:16:46 -06:00
13d02d86be Pull in and set up biome 2026-01-01 17:16:02 -06:00
d35e7bace2 Make shfmt happier 2026-01-01 16:53:19 -06:00
cb4a730838 Make go fmt happier 2026-01-01 16:53:00 -06:00
58f88e3695 Add check.sh and fixup.sh scripts 2026-01-01 16:47:50 -06:00
11 changed files with 189 additions and 6 deletions

30
check.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$DIR"
# Keep exclusions sorted. And list them here.
#
# - SC2002 is useless use of cat
#
exclusions="SC2002"
source "$DIR/framework/versions"
if [[ $# -ne 0 ]]; then
shellcheck --exclude="$exclusions" "$@"
exit $?
fi
shell_scripts="$(fd .sh | xargs)"
# The files we need to check all either end in .sh or else they're the files
# in framework/cmd.d and framework/shims. -x instructs shellcheck to also
# check `source`d files.
shellcheck -x --exclude="$exclusions" "$DIR/cmd" "$DIR"/framework/cmd.d/* "$DIR"/framework/shims/* "$shell_scripts"
pushd "$DIR/master"
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:$golangci_lint golangci-lint run
popd

36
express/biome.jsonc Normal file
View File

@@ -0,0 +1,36 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"includes": ["**", "!!**/dist"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}

View File

@@ -43,6 +43,7 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "2.3.10",
"@types/express": "^5.0.5" "@types/express": "^5.0.5"
} }
} }

91
express/pnpm-lock.yaml generated
View File

@@ -45,6 +45,9 @@ importers:
specifier: ^4.1.12 specifier: ^4.1.12
version: 4.1.12 version: 4.1.12
devDependencies: devDependencies:
'@biomejs/biome':
specifier: 2.3.10
version: 2.3.10
'@types/express': '@types/express':
specifier: ^5.0.5 specifier: ^5.0.5
version: 5.0.5 version: 5.0.5
@@ -88,6 +91,59 @@ packages:
resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==} resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
'@biomejs/biome@2.3.10':
resolution: {integrity: sha512-/uWSUd1MHX2fjqNLHNL6zLYWBbrJeG412/8H7ESuK8ewoRoMPUgHDebqKrPTx/5n6f17Xzqc9hdg3MEqA5hXnQ==}
engines: {node: '>=14.21.3'}
hasBin: true
'@biomejs/cli-darwin-arm64@2.3.10':
resolution: {integrity: sha512-M6xUjtCVnNGFfK7HMNKa593nb7fwNm43fq1Mt71kpLpb+4mE7odO8W/oWVDyBVO4ackhresy1ZYO7OJcVo/B7w==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [darwin]
'@biomejs/cli-darwin-x64@2.3.10':
resolution: {integrity: sha512-Vae7+V6t/Avr8tVbFNjnFSTKZogZHFYl7MMH62P/J1kZtr0tyRQ9Fe0onjqjS2Ek9lmNLmZc/VR5uSekh+p1fg==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [darwin]
'@biomejs/cli-linux-arm64-musl@2.3.10':
resolution: {integrity: sha512-B9DszIHkuKtOH2IFeeVkQmSMVUjss9KtHaNXquYYWCjH8IstNgXgx5B0aSBQNr6mn4RcKKRQZXn9Zu1rM3O0/A==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [linux]
'@biomejs/cli-linux-arm64@2.3.10':
resolution: {integrity: sha512-hhPw2V3/EpHKsileVOFynuWiKRgFEV48cLe0eA+G2wO4SzlwEhLEB9LhlSrVeu2mtSn205W283LkX7Fh48CaxA==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [linux]
'@biomejs/cli-linux-x64-musl@2.3.10':
resolution: {integrity: sha512-QTfHZQh62SDFdYc2nfmZFuTm5yYb4eO1zwfB+90YxUumRCR171tS1GoTX5OD0wrv4UsziMPmrePMtkTnNyYG3g==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [linux]
'@biomejs/cli-linux-x64@2.3.10':
resolution: {integrity: sha512-wwAkWD1MR95u+J4LkWP74/vGz+tRrIQvr8kfMMJY8KOQ8+HMVleREOcPYsQX82S7uueco60L58Wc6M1I9WA9Dw==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [linux]
'@biomejs/cli-win32-arm64@2.3.10':
resolution: {integrity: sha512-o7lYc9n+CfRbHvkjPhm8s9FgbKdYZu5HCcGVMItLjz93EhgJ8AM44W+QckDqLA9MKDNFrR8nPbO4b73VC5kGGQ==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [win32]
'@biomejs/cli-win32-x64@2.3.10':
resolution: {integrity: sha512-pHEFgq7dUEsKnqG9mx9bXihxGI49X+ar+UBrEIj3Wqj3UCZp1rNgV+OoyjFgcXsjCWpuEAF4VJdkZr3TrWdCbQ==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [win32]
'@cspotcode/source-map-support@0.8.1': '@cspotcode/source-map-support@0.8.1':
resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
engines: {node: '>=12'} engines: {node: '>=12'}
@@ -862,6 +918,41 @@ snapshots:
'@babel/helper-string-parser': 7.27.1 '@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.28.5 '@babel/helper-validator-identifier': 7.28.5
'@biomejs/biome@2.3.10':
optionalDependencies:
'@biomejs/cli-darwin-arm64': 2.3.10
'@biomejs/cli-darwin-x64': 2.3.10
'@biomejs/cli-linux-arm64': 2.3.10
'@biomejs/cli-linux-arm64-musl': 2.3.10
'@biomejs/cli-linux-x64': 2.3.10
'@biomejs/cli-linux-x64-musl': 2.3.10
'@biomejs/cli-win32-arm64': 2.3.10
'@biomejs/cli-win32-x64': 2.3.10
'@biomejs/cli-darwin-arm64@2.3.10':
optional: true
'@biomejs/cli-darwin-x64@2.3.10':
optional: true
'@biomejs/cli-linux-arm64-musl@2.3.10':
optional: true
'@biomejs/cli-linux-arm64@2.3.10':
optional: true
'@biomejs/cli-linux-x64-musl@2.3.10':
optional: true
'@biomejs/cli-linux-x64@2.3.10':
optional: true
'@biomejs/cli-win32-arm64@2.3.10':
optional: true
'@biomejs/cli-win32-x64@2.3.10':
optional: true
'@cspotcode/source-map-support@0.8.1': '@cspotcode/source-map-support@0.8.1':
dependencies: dependencies:
'@jridgewell/trace-mapping': 0.3.9 '@jridgewell/trace-mapping': 0.3.9

26
fixup.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
set -eu
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$DIR"
# uv run ruff check --select I --fix .
# uv run ruff format .
shell_scripts="$(fd .sh | xargs)"
shfmt -i 4 -w "$DIR/cmd" "$DIR"/framework/cmd.d/* "$DIR"/framework/shims/*
# "$shell_scripts"
for ss in $shell_scripts; do
shfmt -i 4 -w $ss
done
pushd "$DIR/master"
go fmt
popd
pushd "$DIR/express"
../cmd pnpm biome check --write
popd

View File

@@ -47,6 +47,5 @@ func main() {
<-sigCh <-sigCh
fmt.Println("\nReceived interrupt signal, shutting down...") fmt.Println("\nReceived interrupt signal, shutting down...")
fmt.Println("All processes terminated cleanly") fmt.Println("All processes terminated cleanly")
} }