Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

chore: fix trailing whitespace, EOF, pre-commit config

Bosch317d945b38ab
diff --git a/.github/workflows/branch-naming.yml b/.github/workflows/branch-naming.yml
index 7188b361..70776c12 100644
--- a/.github/workflows/branch-naming.yml
+++ b/.github/workflows/branch-naming.yml
@@ -47,4 +47,4 @@ jobs:
exit 1
fi
- echo "✅ Branch name '$BRANCH' follows convention."
\ No newline at end of file
+ echo "✅ Branch name '$BRANCH' follows convention."
diff --git a/.github/workflows/e2e-cli.yml b/.github/workflows/e2e-cli.yml
index a7b411af..158d3bf9 100644
--- a/.github/workflows/e2e-cli.yml
+++ b/.github/workflows/e2e-cli.yml
@@ -56,25 +56,25 @@ jobs:
--abort-on-container-exit \
--exit-code-from runner 2>&1 | tee e2e-output.log
EXIT_CODE=${PIPESTATUS[0]}
-
+
# Extract summary from logs
PASSED=$(grep -oP 'Passed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")
FAILED=$(grep -oP 'Failed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")
-
+
# Get failed test names if any
FAILURES=$(grep -E '✗.*failed' e2e-output.log | sed 's/.*✗ /- /' | head -10 || true)
-
+
echo "passed=$PASSED" >> $GITHUB_OUTPUT
echo "failed=$FAILED" >> $GITHUB_OUTPUT
echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT
-
+
# Save failures for multiline output
{
echo 'failures<<EOF'
echo "$FAILURES"
echo 'EOF'
} >> $GITHUB_OUTPUT
-
+
exit $EXIT_CODE
- name: Copy results from container
@@ -108,7 +108,7 @@ jobs:
PASSED="${{ steps.e2e.outputs.passed }}"
FAILED="${{ steps.e2e.outputs.failed }}"
FAILURES="${{ steps.e2e.outputs.failures }}"
-
+
if [ "$FAILED" = "0" ] || [ -z "$FAILED" ]; then
echo "::notice title=CLI E2E Tests::✅ ${PASSED:-All} tests passed"
else
diff --git a/.github/workflows/e2e-curl.yml b/.github/workflows/e2e-curl.yml
index 2c98409e..0f1380ff 100644
--- a/.github/workflows/e2e-curl.yml
+++ b/.github/workflows/e2e-curl.yml
@@ -44,7 +44,7 @@ jobs:
timeout-minutes: 15
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
-
+
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -64,24 +64,24 @@ jobs:
--abort-on-container-exit \
--exit-code-from runner 2>&1 | tee e2e-output.log
EXIT_CODE=${PIPESTATUS[0]}
-
+
# Extract summary from logs
PASSED=$(grep -oP 'Passed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")
FAILED=$(grep -oP 'Failed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")
-
+
# Get failed test names if any
FAILURES=$(grep -E '✗.*failed' e2e-output.log | sed 's/.*✗ /- /' | head -10 || true)
-
+
echo "passed=$PASSED" >> $GITHUB_OUTPUT
echo "failed=$FAILED" >> $GITHUB_OUTPUT
echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT
-
+
{
echo 'failures<<EOF'
echo "$FAILURES"
echo 'EOF'
} >> $GITHUB_OUTPUT
-
+
exit $EXIT_CODE
env:
DOCKER_BUILDKIT: 1
@@ -118,7 +118,7 @@ jobs:
PASSED="${{ steps.e2e.outputs.passed }}"
FAILED="${{ steps.e2e.outputs.failed }}"
FAILURES="${{ steps.e2e.outputs.failures }}"
-
+
if [ "$FAILED" = "0" ] || [ -z "$FAILED" ]; then
echo "::notice title=E2E Curl Tests::✅ ${PASSED:-All} tests passed"
else
diff --git a/.github/workflows/go-verify.yml b/.github/workflows/go-verify.yml
index 8340e4a0..070fcac7 100644
--- a/.github/workflows/go-verify.yml
+++ b/.github/workflows/go-verify.yml
@@ -123,7 +123,7 @@ jobs:
if: steps.check.outputs.has_go_changes == 'true'
with:
go-version: '1.26'
-
+
- uses: oven-sh/setup-bun@v2
if: needs.changes.outputs.go == 'true'
with:
diff --git a/.github/workflows/npm-verify.yml b/.github/workflows/npm-verify.yml
index 031438d9..ac96b3a8 100644
--- a/.github/workflows/npm-verify.yml
+++ b/.github/workflows/npm-verify.yml
@@ -90,9 +90,9 @@ jobs:
"bin/pinchtab"
"LICENSE"
)
-
+
PACK_OUTPUT=$(npm pack --dry-run 2>&1)
-
+
for file in "${REQUIRED[@]}"; do
if echo "$PACK_OUTPUT" | grep -q "$file"; then
echo "✅ $file"
@@ -120,7 +120,7 @@ jobs:
{ name: 'postinstall script', value: !!pkg.scripts.postinstall },
{ name: 'bin.pinchtab', value: !!pkg.bin.pinchtab }
];
-
+
let failed = false;
checks.forEach(check => {
if (check.value) {
@@ -130,7 +130,7 @@ jobs:
failed = true;
}
});
-
+
if (failed) process.exit(1);
"
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 12ffc8f7..d2cef6de 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,7 +1,7 @@
name: Release
# Automatic release pipeline triggered on tag push (v0.7.0, etc.)
-#
+#
# Pipeline:
# 1. Checkout tag
# 2. Build Go binary + create GitHub release (goreleaser)
@@ -45,7 +45,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: '1.26'
-
+
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
@@ -53,7 +53,7 @@ jobs:
- name: Install dashboard dependencies
working-directory: dashboard
run: bun install --frozen-lockfile
-
+
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d1d0132f..40b2f651 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -7,15 +7,16 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
+ exclude: 'tsconfig\..+\.json$'
- id: check-merge-conflict
- id: check-added-large-files
args: ['--maxkb=500']
# Go formatting
- repo: https://github.com/golangci/golangci-lint
- rev: v1.55.2
+ rev: v2.1.6
hooks:
- - id: golangci-lint-full
+ - id: golangci-lint
args: ['--timeout=5m']
# Markdown linting (relaxed for docs)
diff --git a/Dockerfile b/Dockerfile
index 5b1c9e6a..18d15d45 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -23,7 +23,7 @@ RUN go build -ldflags="-s -w" -o pinchtab ./cmd/pinchtab
# Stage 3: Minimal runtime image with Chromium.
# Only the compiled binary and entrypoint script are copied in.
-#
+#
# Security model:
# - Chrome runs with --no-sandbox (set by entrypoint) because containers don't
# have user namespaces for sandboxing
diff --git a/RELEASE.md b/RELEASE.md
index 22b2677f..1cbccdb3 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -18,7 +18,7 @@ Go to **Settings → Secrets and variables → Actions** and add:
- **NPM_TOKEN** — npm authentication token
- Create at https://npmjs.com/settings/~/tokens
- Scope: `automation` (publish + read)
-
+
- **DOCKERHUB_USER** — Docker Hub username (if using Docker Hub)
- **DOCKERHUB_TOKEN** — Docker Hub personal access token
diff --git a/cmd/pinchtab/root.go b/cmd/pinchtab/root.go
index ab306679..b4e75439 100644
--- a/cmd/pinchtab/root.go
+++ b/cmd/pinchtab/root.go
@@ -15,7 +15,7 @@ var version = "dev"
var rootCmd = &cobra.Command{
Use: "pinchtab",
Short: "PinchTab - Browser control for AI agents",
- Long: `PinchTab provides a lightweight, API-driven way for AI agents to control
+ Long: `PinchTab provides a lightweight, API-driven way for AI agents to control
browsers, manage tabs, and perform interactive tasks.`,
Example: ` pinchtab server
pinchtab nav https://pinchtab.com`,
diff --git a/dev b/dev
index f5923430..662fdfaf 100755
--- a/dev
+++ b/dev
@@ -244,7 +244,7 @@ pick_with_select() {
if [ $# -gt 0 ]; then
case "$1" in
-h|--help|help) show_help; exit 0 ;;
- -i|--interactive)
+ -i|--interactive)
if command -v gum &>/dev/null; then pick_with_gum; else pick_with_select; fi
exit 0
;;
diff --git a/docker-entrypoint-release.sh b/docker-entrypoint-release.sh
index a9288ac4..34325c55 100644
--- a/docker-entrypoint-release.sh
+++ b/docker-entrypoint-release.sh
@@ -19,7 +19,7 @@ if [ -z "${PINCHTAB_CONFIG:-}" ] && [ ! -f "$default_config_path" ]; then
fi
# RUNTIME BIND OVERRIDE FOR DOCKER PORT PUBLISHING
-#
+#
# The persisted config stores bind: "127.0.0.1" (secure loopback default).
# But Docker port publishing requires the process to listen on 0.0.0.0 inside
# the container, so the host can forward traffic to it.
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index a9288ac4..34325c55 100644
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -19,7 +19,7 @@ if [ -z "${PINCHTAB_CONFIG:-}" ] && [ ! -f "$default_config_path" ]; then
fi
# RUNTIME BIND OVERRIDE FOR DOCKER PORT PUBLISHING
-#
+#
# The persisted config stores bind: "127.0.0.1" (secure loopback default).
# But Docker port publishing requires the process to listen on 0.0.0.0 inside
# the container, so the host can forward traffic to it.
diff --git a/docs/core-concepts.md b/docs/core-concepts.md
index cc1f075e..e8a2aabc 100644
--- a/docs/core-concepts.md
+++ b/docs/core-concepts.md
@@ -309,4 +309,3 @@ The durable object in PinchTab is the **profile**.
The runtime object is the **instance**.
The page object is the **tab**.
The **server** manages them, and the **bridge** executes them.
-
diff --git a/docs/dashboard.md b/docs/dashboard.md
index 767dfcb1..39e86a9a 100644
--- a/docs/dashboard.md
+++ b/docs/dashboard.md
@@ -223,4 +223,3 @@ pinchtab instance start
### No live profile preview
The profile must have a running instance before the Live tab in the profile details modal can show live tab data.
-
diff --git a/docs/deep-dive/lite-engin-prototype.md b/docs/deep-dive/lite-engin-prototype.md
index 6a8110b4..a3f6e42c 100644
--- a/docs/deep-dive/lite-engin-prototype.md
+++ b/docs/deep-dive/lite-engin-prototype.md
@@ -1,8 +1,8 @@
# Lite Engine: Chrome-Free DOM Capture using Gost-DOM
-**Branch:** `feat/lite-engine-gostdom`
-**Issue:** [#201](https://github.com/pinchtab/pinchtab/issues/201)
-**Related Draft PR:** [#200](https://github.com/pinchtab/pinchtab/pull/200)
+**Branch:** `feat/lite-engine-gostdom`
+**Issue:** [#201](https://github.com/pinchtab/pinchtab/issues/201)
+**Related Draft PR:** [#200](https://github.com/pinchtab/pinchtab/pull/200)
**Dependency:** [gost-dom/browser v0.11.0](https://github.com/gost-dom/browser) (MIT, ~255 stars, Go 78.4%)
---
@@ -226,7 +226,7 @@ Lite-served responses include `X-Engine: lite` header for observability.
## Performance Benchmark: Lite vs Chrome
-**Lite run:** 2026-03-09 | **Chrome run:** 2026-03-09
+**Lite run:** 2026-03-09 | **Chrome run:** 2026-03-09
**Method:** 8 real-world websites × 4 operations each (Navigate → Snapshot All → Snapshot Interactive → Text)
### Response Times (ms)
diff --git a/docs/get-started.md b/docs/get-started.md
index a6ebc427..ec609fe3 100644
--- a/docs/get-started.md
+++ b/docs/get-started.md
@@ -168,4 +168,3 @@ CHROME_BIN=/path/to/chrome pinchtab
- [GitHub Issues](https://github.com/pinchtab/pinchtab/issues)
- [GitHub Discussions](https://github.com/pinchtab/pinchtab/discussions)
-
diff --git a/docs/guides/data-storage.md b/docs/guides/data-storage.md
index 7726d96d..d2c3ffb2 100644
--- a/docs/guides/data-storage.md
+++ b/docs/guides/data-storage.md
@@ -188,4 +188,3 @@ Removing the PinchTab data directory deletes:
- local configuration
Back up the profile directories first if you need to preserve logged-in browser sessions.
-
diff --git a/docs/guides/memory-monitoring.md b/docs/guides/memory-monitoring.md
index d608a5ef..73bdb232 100644
--- a/docs/guides/memory-monitoring.md
+++ b/docs/guides/memory-monitoring.md
@@ -127,4 +127,3 @@ This is usually closer to “what the OS sees” than to a narrow JavaScript hea
### Numbers Do Not Match Activity Monitor Or Task Manager Exactly
Different tools report different memory definitions. PinchTab currently reports RSS-based totals for the Chrome process tree it owns.
-
diff --git a/docs/guides/multi-instance.md b/docs/guides/multi-instance.md
index 7c8e307e..60c6a3de 100644
--- a/docs/guides/multi-instance.md
+++ b/docs/guides/multi-instance.md
@@ -141,4 +141,3 @@ Prefer explicit instance APIs when:
- you want separate headed and headless browsers at the same time
- you need stable profile-to-instance ownership rules
- you are building tooling that should never depend on implicit auto-launch
-
diff --git a/docs/guides/raspberry-pi.md b/docs/guides/raspberry-pi.md
index 9284a032..3f2d6cb7 100644
--- a/docs/guides/raspberry-pi.md
+++ b/docs/guides/raspberry-pi.md
@@ -190,5 +190,3 @@ Override the server port:
```bash
PINCHTAB_PORT=9868 ./pinchtab
```
-
-
diff --git a/docs/headless-vs-headed.md b/docs/headless-vs-headed.md
index 8f99ecf6..c92ed48d 100644
--- a/docs/headless-vs-headed.md
+++ b/docs/headless-vs-headed.md
@@ -244,4 +244,3 @@ Useful views:
- Use **headless** for unattended automation and scale.
- Use **headed** for local debugging and human-visible workflows.
- Choose the mode per instance, not per server.
-
diff --git a/docs/reference/click.md b/docs/reference/click.md
index c2bb4d2c..cf302b55 100644
--- a/docs/reference/click.md
+++ b/docs/reference/click.md
@@ -26,4 +26,3 @@ Notes:
- [Snapshot](./snapshot.md)
- [Navigate](./navigate.md)
-
diff --git a/docs/reference/eval.md b/docs/reference/eval.md
index 972e37bd..4b64b531 100644
--- a/docs/reference/eval.md
+++ b/docs/reference/eval.md
@@ -23,4 +23,3 @@ Notes:
- [Config](./config.md)
- [Tabs](./tabs.md)
-
diff --git a/docs/reference/fill.md b/docs/reference/fill.md
index bbffcc09..99b7d47c 100644
--- a/docs/reference/fill.md
+++ b/docs/reference/fill.md
@@ -26,4 +26,3 @@ Notes:
- [Type](./type.md)
- [Snapshot](./snapshot.md)
-
diff --git a/docs/reference/health.md b/docs/reference/health.md
index 81e4fed6..49290814 100644
--- a/docs/reference/health.md
+++ b/docs/reference/health.md
@@ -67,4 +67,3 @@ Notes:
- [Tabs](./tabs.md)
- [Navigate](./navigate.md)
- [Strategies](./strategies.md)
-
diff --git a/docs/reference/hover.md b/docs/reference/hover.md
index 2f7e8006..51c92631 100644
--- a/docs/reference/hover.md
+++ b/docs/reference/hover.md
@@ -23,4 +23,3 @@ Use this when menus or tooltips appear only after hover.
- [Click](./click.md)
- [Snapshot](./snapshot.md)
-
diff --git a/docs/reference/navigate.md b/docs/reference/navigate.md
index d01c6d94..73115b81 100644
--- a/docs/reference/navigate.md
+++ b/docs/reference/navigate.md
@@ -25,4 +25,3 @@ Useful flags:
- [Snapshot](./snapshot.md)
- [Tabs](./tabs.md)
-
diff --git a/docs/reference/pdf.md b/docs/reference/pdf.md
index 1dd765ce..187f9ecf 100644
--- a/docs/reference/pdf.md
+++ b/docs/reference/pdf.md
@@ -22,4 +22,3 @@ Useful flags:
- [Text](./text.md)
- [Screenshot](./screenshot.md)
-
diff --git a/docs/reference/press.md b/docs/reference/press.md
index 1ae1cf0e..d8f6faa1 100644
--- a/docs/reference/press.md
+++ b/docs/reference/press.md
@@ -23,4 +23,3 @@ Common keys include `Enter`, `Tab`, and `Escape`.
- [Click](./click.md)
- [Focus](./focus.md)
-
diff --git a/docs/reference/scheduler.md b/docs/reference/scheduler.md
index 3a151d12..afa7d19c 100644
--- a/docs/reference/scheduler.md
+++ b/docs/reference/scheduler.md
@@ -452,4 +452,4 @@ cw.Start()
defer cw.Stop()
```
-`loadFn` is a `func() (Config, error)` that reads the current config from disk or environment.
\ No newline at end of file
+`loadFn` is a `func() (Config, error)` that reads the current config from disk or environment.
diff --git a/docs/reference/screenshot.md b/docs/reference/screenshot.md
index 8ccb61ec..2d775d13 100644
--- a/docs/reference/screenshot.md
+++ b/docs/reference/screenshot.md
@@ -24,4 +24,3 @@ Useful flags:
- [Snapshot](./snapshot.md)
- [PDF](./pdf.md)
-
diff --git a/docs/reference/scroll.md b/docs/reference/scroll.md
index e043859b..eba9842c 100644
--- a/docs/reference/scroll.md
+++ b/docs/reference/scroll.md
@@ -26,4 +26,3 @@ Notes:
- [Snapshot](./snapshot.md)
- [Text](./text.md)
-
diff --git a/docs/reference/select.md b/docs/reference/select.md
index e0b8da90..761b64a7 100644
--- a/docs/reference/select.md
+++ b/docs/reference/select.md
@@ -23,4 +23,3 @@ The `value` should match the option value expected by the page.
- [Snapshot](./snapshot.md)
- [Focus](./focus.md)
-
diff --git a/docs/reference/snapshot.md b/docs/reference/snapshot.md
index 98831222..4ece3ff2 100644
--- a/docs/reference/snapshot.md
+++ b/docs/reference/snapshot.md
@@ -30,4 +30,3 @@ Useful flags:
- [Click](./click.md)
- [Tabs](./tabs.md)
-
diff --git a/docs/reference/text.md b/docs/reference/text.md
index 8917e7c7..f61ede28 100644
--- a/docs/reference/text.md
+++ b/docs/reference/text.md
@@ -24,4 +24,3 @@ Useful flags:
- [Snapshot](./snapshot.md)
- [PDF](./pdf.md)
-
diff --git a/docs/reference/type.md b/docs/reference/type.md
index b9f8d24a..c4799edd 100644
--- a/docs/reference/type.md
+++ b/docs/reference/type.md
@@ -26,4 +26,3 @@ Notes:
- [Fill](./fill.md)
- [Snapshot](./snapshot.md)
-
diff --git a/install.sh b/install.sh
index 66663705..8330c010 100755
--- a/install.sh
+++ b/install.sh
@@ -109,7 +109,7 @@ check_npm() {
check_chrome() {
local chrome_found=false
local chrome_path=""
-
+
# Check common Chrome/Chromium locations
local candidates=(
"google-chrome"
@@ -123,7 +123,7 @@ check_chrome() {
"/usr/bin/chromium"
"/usr/bin/chromium-browser"
)
-
+
for candidate in "${candidates[@]}"; do
if command -v "$candidate" &> /dev/null || [[ -f "$candidate" ]]; then
chrome_found=true
@@ -131,7 +131,7 @@ check_chrome() {
break
fi
done
-
+
if [[ "$chrome_found" == true ]]; then
ui_success "Chrome/Chromium found: $chrome_path"
else
@@ -165,7 +165,7 @@ check_chrome() {
install_pinchtab() {
ui_section "Installing Pinchtab"
-
+
if npm install -g pinchtab > "$LOGFILE" 2>&1; then
ui_success "Pinchtab installed successfully"
return 0
@@ -173,7 +173,7 @@ install_pinchtab() {
local exit_code=$?
ui_error "npm install failed"
echo ""
-
+
# Check for permission error
if grep -q "EACCES\|permission denied" "$LOGFILE"; then
echo "This is a permission error. Try one of these:"
@@ -233,7 +233,7 @@ show_next_steps() {
main() {
print_banner
setup_logfile
-
+
detect_os
check_node
check_npm
@@ -241,7 +241,7 @@ main() {
install_pinchtab
verify_installation
show_next_steps
-
+
ui_section "Installation complete!"
echo -e "Run ${ACCENT}${BOLD}pinchtab${NC} to start 🦀"
echo ""
diff --git a/internal/assets/stealth.js b/internal/assets/stealth.js
index 43c576d2..cc20fb49 100644
--- a/internal/assets/stealth.js
+++ b/internal/assets/stealth.js
@@ -13,9 +13,9 @@ const seededRandom = (function() {
};
})();
-Object.defineProperty(navigator, 'webdriver', {
+Object.defineProperty(navigator, 'webdriver', {
get: () => undefined,
- configurable: true
+ configurable: true
});
delete window.cdc_adoQpoasnfa76pfcZLmcfl_Array;
@@ -150,7 +150,7 @@ if (window.RTCPeerConnection) {
const __pinchtab_origGetTimezoneOffset = Date.prototype.getTimezoneOffset;
Object.defineProperty(Date.prototype, 'getTimezoneOffset', {
- value: function() {
+ value: function() {
return window.__pinchtab_timezone || __pinchtab_origGetTimezoneOffset.call(this);
}
});
diff --git a/scripts/check-docs-json.sh b/scripts/check-docs-json.sh
index 82a0ff2a..5b5e0356 100755
--- a/scripts/check-docs-json.sh
+++ b/scripts/check-docs-json.sh
@@ -48,7 +48,7 @@ missing_files=()
# Check each file exists
for file in $files; do
full_path="$DOCS_DIR/$file"
-
+
if [ ! -f "$full_path" ]; then
missing_files+=("$file")
fi
diff --git a/scripts/check-gosec.sh b/scripts/check-gosec.sh
index 2625cfb5..7082bed9 100755
--- a/scripts/check-gosec.sh
+++ b/scripts/check-gosec.sh
@@ -57,7 +57,7 @@ if [ "$ISSUES" -gt 0 ]; then
exit 1
else
echo "✅ No critical issues (CI will pass)"
-
+
TOTAL=$(cat gosec-results.json | jq '.Stats.found')
if [ "$TOTAL" -gt 0 ]; then
echo ""
diff --git a/scripts/pre-commit b/scripts/pre-commit
index 994a6416..7abc5a79 100755
--- a/scripts/pre-commit
+++ b/scripts/pre-commit
@@ -11,7 +11,7 @@ echo "🔍 Running pre-commit checks..."
staged_go=$(git diff --cached --name-only --diff-filter=ACM | grep '\.go$' || true)
if [ -n "$staged_go" ]; then
echo "📦 Checking Go files..."
-
+
# gofmt check
unformatted=$(gofmt -l $staged_go 2>/dev/null || true)
if [ -n "$unformatted" ]; then
@@ -31,7 +31,7 @@ if [ -n "$staged_go" ]; then
else
echo "⚠️ golangci-lint not found, skipping Go lint"
fi
-
+
echo "✅ Go checks passed"
fi
@@ -41,9 +41,9 @@ fi
staged_web=$(git diff --cached --name-only --diff-filter=ACM | grep '^dashboard/.*\.\(ts\|tsx\|js\|jsx\|css\)$' || true)
if [ -n "$staged_web" ]; then
echo "🌐 Checking dashboard files..."
-
+
cd dashboard
-
+
# Check if bun is available
if ! command -v bun &>/dev/null; then
echo "⚠️ bun not found, skipping dashboard checks"
@@ -56,7 +56,7 @@ if [ -n "$staged_web" ]; then
cd ..
exit 1
fi
-
+
# ESLint check
echo " → ESLint..."
if ! bun run lint 2>/dev/null; then
@@ -64,7 +64,7 @@ if [ -n "$staged_web" ]; then
cd ..
exit 1
fi
-
+
# Prettier check (on staged files only)
echo " → Prettier..."
staged_rel=$(echo "$staged_web" | sed 's|^dashboard/||')
@@ -74,7 +74,7 @@ if [ -n "$staged_web" ]; then
cd ..
exit 1
fi
-
+
cd ..
echo "✅ Dashboard checks passed"
fi
diff --git a/tests/e2e/fixtures/buttons.html b/tests/e2e/fixtures/buttons.html
index a27f88c7..7aa26a11 100644
--- a/tests/e2e/fixtures/buttons.html
+++ b/tests/e2e/fixtures/buttons.html
@@ -11,7 +11,7 @@
</head>
<body>
<h1>Buttons Test</h1>
-
+
<section id="counter-section">
<h2>Counter</h2>
<div class="counter">Count: <span id="count">0</span></div>
@@ -39,27 +39,27 @@
<script>
let count = 0;
const countEl = document.getElementById('count');
-
+
document.getElementById('increment').addEventListener('click', () => {
count++;
countEl.textContent = count;
});
-
+
document.getElementById('decrement').addEventListener('click', () => {
count--;
countEl.textContent = count;
});
-
+
document.getElementById('reset').addEventListener('click', () => {
count = 0;
countEl.textContent = count;
});
-
+
document.getElementById('toggle-btn').addEventListener('click', () => {
const content = document.getElementById('toggle-content');
content.style.display = content.style.display === 'none' ? 'block' : 'none';
});
-
+
document.getElementById('show-message').addEventListener('click', () => {
document.getElementById('message').style.display = 'block';
});
diff --git a/tests/e2e/fixtures/evaluate.html b/tests/e2e/fixtures/evaluate.html
index 0fa3a2d2..7c58a783 100644
--- a/tests/e2e/fixtures/evaluate.html
+++ b/tests/e2e/fixtures/evaluate.html
@@ -11,7 +11,7 @@
</head>
<body>
<h1>JavaScript Evaluate Test Page</h1>
-
+
<div class="result">
<p>Counter: <span id="counter">0</span></p>
<button onclick="increment()">Increment</button>
diff --git a/tests/e2e/fixtures/find.html b/tests/e2e/fixtures/find.html
index 2e8fdc4c..15831582 100644
--- a/tests/e2e/fixtures/find.html
+++ b/tests/e2e/fixtures/find.html
@@ -15,7 +15,7 @@
</head>
<body>
<h1>Element Finder Test Page</h1>
-
+
<div class="section">
<h2>Authentication</h2>
<input type="email" placeholder="Email address" aria-label="Email">
diff --git a/tests/e2e/scenarios-cli/common.sh b/tests/e2e/scenarios-cli/common.sh
index a9a09ef4..0f773e41 100755
--- a/tests/e2e/scenarios-cli/common.sh
+++ b/tests/e2e/scenarios-cli/common.sh
@@ -109,18 +109,18 @@ end_test() {
pt() {
local tmpout=$(mktemp)
local tmperr=$(mktemp)
-
+
echo -e " ${BLUE}→ PINCHTAB_URL=$PINCHTAB_URL pinchtab $@${NC}"
-
+
set +e
PINCHTAB_URL="$PINCHTAB_URL" pinchtab "$@" > "$tmpout" 2> "$tmperr"
PT_CODE=$?
set -e
-
+
PT_OUT=$(cat "$tmpout")
PT_ERR=$(cat "$tmperr")
rm -f "$tmpout" "$tmperr"
-
+
if [ -n "$PT_OUT" ]; then
echo "$PT_OUT" | head -5
fi
@@ -161,7 +161,7 @@ pt_fail() {
assert_output_contains() {
local expected="$1"
local desc="${2:-output contains '$expected'}"
-
+
if echo "$PT_OUT" | grep -q "$expected"; then
echo -e " ${GREEN}✓${NC} $desc"
((ASSERTIONS_PASSED++)) || true
@@ -260,7 +260,7 @@ assert_file_exists() {
assert_output_not_contains() {
local forbidden="$1"
local desc="${2:-output does not contain '$forbidden'}"
-
+
if echo "$PT_OUT" | grep -q "$forbidden"; then
echo -e " ${RED}✗${NC} $desc"
echo -e " ${RED} output was: $PT_OUT${NC}"
@@ -274,7 +274,7 @@ assert_output_not_contains() {
# Assert PT_OUT is valid JSON
assert_output_json() {
local desc="${1:-output is valid JSON}"
-
+
if echo "$PT_OUT" | jq . > /dev/null 2>&1; then
echo -e " ${GREEN}✓${NC} $desc"
((ASSERTIONS_PASSED++)) || true
@@ -290,10 +290,10 @@ assert_json_field() {
local path="$1"
local expected="$2"
local desc="${3:-$path equals '$expected'}"
-
+
local actual
actual=$(echo "$PT_OUT" | jq -r "$path" 2>/dev/null)
-
+
if [ "$actual" = "$expected" ]; then
echo -e " ${GREEN}✓${NC} $desc"
((ASSERTIONS_PASSED++)) || true
diff --git a/tests/e2e/scenarios/11-security.sh b/tests/e2e/scenarios/11-security.sh
index 8f286c25..6b10c05d 100755
--- a/tests/e2e/scenarios/11-security.sh
+++ b/tests/e2e/scenarios/11-security.sh
@@ -70,7 +70,7 @@ assert_contains "$RESULT" "download_disabled" "correct error code"
end_test
# ═══════════════════════════════════════════════════════════════════
-# UPLOAD SECURITY
+# UPLOAD SECURITY
# ═══════════════════════════════════════════════════════════════════
start_test "security: upload ALLOWED when enabled"
diff --git a/tests/e2e/scenarios/common.sh b/tests/e2e/scenarios/common.sh
index ceedd186..b9f587b7 100755
--- a/tests/e2e/scenarios/common.sh
+++ b/tests/e2e/scenarios/common.sh
@@ -86,7 +86,7 @@ start_test() {
end_test() {
local end_time=$(get_time_ms)
local duration=$((end_time - TEST_START_TIME))
-
+
if [ "$ASSERTIONS_FAILED" -eq 0 ]; then
echo -e "${GREEN}✓ ${CURRENT_TEST} passed${NC} ${MUTED}(${duration}ms)${NC}\n"
TEST_RESULTS+=("✅ ${CURRENT_TEST}|${duration}ms|passed")
@@ -106,10 +106,10 @@ assert_json_eq() {
local path="$2"
local expected="$3"
local desc="${4:-$path = $expected}"
-
+
local actual
actual=$(echo "$json" | jq -r "$path")
-
+
if [ "$actual" = "$expected" ]; then
echo -e " ${GREEN}✓${NC} $desc"
((ASSERTIONS_PASSED++)) || true
@@ -125,10 +125,10 @@ assert_json_contains() {
local path="$2"
local needle="$3"
local desc="${4:-$path contains '$needle'}"
-
+
local actual
actual=$(echo "$json" | jq -r "$path")
-
+
if [[ "$actual" == *"$needle"* ]]; then
echo -e " ${GREEN}✓${NC} $desc"
((ASSERTIONS_PASSED++)) || true
@@ -144,10 +144,10 @@ assert_json_length() {
local path="$2"
local expected="$3"
local desc="${4:-$path length = $expected}"
-
+
local actual
actual=$(echo "$json" | jq "$path | length")
-
+
if [ "$actual" -eq "$expected" ]; then
echo -e " ${GREEN}✓${NC} $desc"
((ASSERTIONS_PASSED++)) || true
@@ -163,10 +163,10 @@ assert_json_length_gte() {
local path="$2"
local expected="$3"
local desc="${4:-$path length >= $expected}"
-
+
local actual
actual=$(echo "$json" | jq "$path | length")
-
+
if [ "$actual" -ge "$expected" ]; then
echo -e " ${GREEN}✓${NC} $desc"
((ASSERTIONS_PASSED++)) || true
@@ -181,7 +181,7 @@ assert_json_exists() {
local json="$1"
local path="$2"
local desc="${3:-$path exists}"
-
+
if echo "$json" | jq -e "$path" >/dev/null 2>&1; then
echo -e " ${GREEN}✓${NC} $desc"
((ASSERTIONS_PASSED++)) || true
@@ -196,7 +196,7 @@ assert_contains() {
local haystack="$1"
local needle="$2"
local desc="${3:-contains '$needle'}"
-
+
if echo "$haystack" | grep -q "$needle"; then
echo -e " ${GREEN}✓${NC} $desc"
((ASSERTIONS_PASSED++)) || true
@@ -249,10 +249,10 @@ assert_http_error() {
local expected_status="$1"
local error_pattern="${2:-error}"
local desc="${3:-HTTP $expected_status error}"
-
+
local actual_status
actual_status=$(echo "$RESULT" | jq -r '.status // empty')
-
+
if [ "$actual_status" = "$expected_status" ] || grep -q "$error_pattern" <<< "$RESULT"; then
echo -e " ${GREEN}✓${NC} $desc"
((ASSERTIONS_PASSED++)) || true
@@ -268,7 +268,7 @@ assert_contains_any() {
local haystack="$1"
local patterns="$2" # pipe-separated
local desc="${3:-contains expected pattern}"
-
+
if echo "$haystack" | grep -qE "$patterns"; then
echo -e " ${GREEN}✓${NC} $desc"
((ASSERTIONS_PASSED++)) || true
@@ -383,7 +383,7 @@ pt_post_raw() {
assert_url_accessible() {
local url="$1"
local label="${2:-$url}"
-
+
if curl -sf "$url" > /dev/null 2>&1; then
echo -e " ${GREEN}✓${NC} GET $label"
((ASSERTIONS_PASSED++)) || true
@@ -412,7 +412,7 @@ assert_fixtures_accessible() {
# Assert last request returned expected status (uses $HTTP_STATUS from pinchtab())
assert_ok() {
local label="${1:-request}"
-
+
if [ "$HTTP_STATUS" = "200" ] || [ "$HTTP_STATUS" = "201" ]; then
echo -e " ${GREEN}✓${NC} $label → $HTTP_STATUS"
((ASSERTIONS_PASSED++)) || true
@@ -426,7 +426,7 @@ assert_ok() {
assert_http_status() {
local expected="$1"
local label="${2:-request}"
-
+
if [ "$HTTP_STATUS" = "$expected" ]; then
echo -e " ${GREEN}✓${NC} $label → $HTTP_STATUS"
((ASSERTIONS_PASSED++)) || true
@@ -439,7 +439,7 @@ assert_http_status() {
# Assert last request returned non-200 status (error expected)
assert_not_ok() {
local label="${1:-request}"
-
+
if [ "$HTTP_STATUS" != "200" ] && [ "$HTTP_STATUS" != "201" ]; then
echo -e " ${GREEN}✓${NC} $label → $HTTP_STATUS (error expected)"
((ASSERTIONS_PASSED++)) || true
@@ -458,7 +458,7 @@ click_button() {
local name="$1"
local ref
ref=$(echo "$RESULT" | jq -r ".nodes[] | select(.name == \"$name\") | .ref" | head -1)
-
+
if [ -n "$ref" ] && [ "$ref" != "null" ]; then
pt_post /action "{\"kind\":\"click\",\"ref\":\"${ref}\"}" > /dev/null
echo -e " ${GREEN}✓${NC} clicked '$name' (ref: $ref)"
@@ -475,12 +475,12 @@ type_into() {
local text="$2"
local ref
ref=$(echo "$RESULT" | jq -r ".nodes[] | select(.name == \"$name\") | .ref" | head -1)
-
+
# Fallback to textbox role if name not found
if [ -z "$ref" ] || [ "$ref" = "null" ]; then
ref=$(echo "$RESULT" | jq -r '.nodes[] | select(.role == "textbox") | .ref' | head -1)
fi
-
+
if [ -n "$ref" ] && [ "$ref" != "null" ]; then
pt_post /action "{\"kind\":\"type\",\"ref\":\"${ref}\",\"text\":\"${text}\"}" > /dev/null
echo -e " ${GREEN}✓${NC} typed '$text' into '$name' (ref: $ref)"
@@ -543,7 +543,7 @@ show_tab() {
assert_tab_count() {
local expected="$1"
local actual=$(get_tab_count)
-
+
if [ "$actual" -eq "$expected" ]; then
echo -e " ${GREEN}✓${NC} tab count = $actual"
((ASSERTIONS_PASSED++)) || true
@@ -557,7 +557,7 @@ assert_tab_count() {
assert_tab_count_gte() {
local min="$1"
local actual=$(get_tab_count)
-
+
if [ "$actual" -ge "$min" ]; then
echo -e " ${GREEN}✓${NC} tab count $actual >= $min"
((ASSERTIONS_PASSED++)) || true
@@ -571,7 +571,7 @@ assert_tab_count_gte() {
assert_tab_closed() {
local before="$1"
local actual=$(get_tab_count)
-
+
if [ "$actual" -lt "$before" ]; then
echo -e " ${GREEN}✓${NC} tab closed (before: $before, after: $actual)"
((ASSERTIONS_PASSED++)) || true
@@ -660,13 +660,13 @@ assert_buttons_page() {
local snap="$1"
local expected_buttons=("Increment" "Decrement" "Reset")
local found=0
-
+
for btn in "${expected_buttons[@]}"; do
if echo "$snap" | jq -e ".nodes[] | select(.name == \"$btn\")" > /dev/null 2>&1; then
((found++))
fi
done
-
+
if [ "$found" -ge 3 ]; then
echo -e " ${GREEN}✓${NC} buttons.html: found $found/3 expected buttons"
((ASSERTIONS_PASSED++)) || true
@@ -680,17 +680,17 @@ assert_buttons_page() {
assert_form_page() {
local snap="$1"
local checks=0
-
+
# Check for textboxes (username, email)
local textboxes=$(echo "$snap" | jq '[.nodes[] | select(.role == "textbox")] | length')
[ "$textboxes" -ge 2 ] && ((checks++))
-
+
# Check for Submit button
echo "$snap" | jq -e '.nodes[] | select(.name == "Submit")' > /dev/null 2>&1 && ((checks++))
-
+
# Check for combobox (country select)
echo "$snap" | jq -e '.nodes[] | select(.role == "combobox")' > /dev/null 2>&1 && ((checks++))
-
+
if [ "$checks" -ge 3 ]; then
echo -e " ${GREEN}✓${NC} form.html: found inputs, submit button, and select"
((ASSERTIONS_PASSED++)) || true
@@ -704,11 +704,11 @@ assert_form_page() {
assert_table_page() {
local text="$1"
local checks=0
-
+
echo "$text" | grep -q "Alice Johnson" && ((checks++))
echo "$text" | grep -q "[email protected]" && ((checks++))
echo "$text" | grep -q "Active" && ((checks++))
-
+
if [ "$checks" -ge 3 ]; then
echo -e " ${GREEN}✓${NC} table.html: found expected table data"
((ASSERTIONS_PASSED++)) || true
@@ -721,7 +721,7 @@ assert_table_page() {
# index.html: Welcome header
assert_index_page() {
local snap="$1"
-
+
if echo "$snap" | jq -e '.title' | grep -q "E2E Test"; then
echo -e " ${GREEN}✓${NC} index.html: correct title"
((ASSERTIONS_PASSED++)) || true
@@ -735,7 +735,7 @@ assert_index_page() {
print_summary() {
local total=$((TESTS_PASSED + TESTS_FAILED))
local total_time=0
-
+
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo -e "${BLUE}E2E Test Summary${NC}"
@@ -754,7 +754,7 @@ print_summary() {
printf " %-${name_width}s %10s %10s\n" "Test" "Duration" "Status"
echo " ${separator}"
-
+
for result in "${TEST_RESULTS[@]}"; do
IFS='|' read -r name duration status <<< "$result"
local time_num=${duration%ms}
@@ -765,7 +765,7 @@ print_summary() {
printf " %-${name_width}s %10s ${RED}%10s${NC}\n" "$name" "$duration" "✗"
fi
done
-
+
echo " ${separator}"
printf " %-${name_width}s %10s\n" "Total" "${total_time}ms"
echo ""
@@ -773,7 +773,7 @@ print_summary() {
echo -e " ${RED}Failed:${NC} ${TESTS_FAILED}/${total}"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
-
+
# Generate markdown report for CI
if [ -d "${RESULTS_DIR:-}" ]; then
generate_markdown_report > "${RESULTS_DIR}/report.md"
@@ -782,7 +782,7 @@ print_summary() {
echo "total_time=${total_time}ms" >> "${RESULTS_DIR}/summary.txt"
echo "timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "${RESULTS_DIR}/summary.txt"
fi
-
+
if [ "$TESTS_FAILED" -gt 0 ]; then
exit 1
fi
@@ -792,7 +792,7 @@ print_summary() {
generate_markdown_report() {
local total=$((TESTS_PASSED + TESTS_FAILED))
local total_time=0
-
+
echo "## 🦀 PinchTab E2E Test Report"
echo ""
if [ "$TESTS_FAILED" -eq 0 ]; then
@@ -803,7 +803,7 @@ generate_markdown_report() {
echo ""
echo "| Test | Duration | Status |"
echo "|------|----------|--------|"
-
+
for result in "${TEST_RESULTS[@]}"; do
IFS='|' read -r name duration status <<< "$result"
local time_num=${duration%ms}
@@ -815,7 +815,7 @@ generate_markdown_report() {
clean_name="${clean_name#❌ }"
echo "| ${clean_name} | ${duration} | ${icon} |"
done
-
+
echo ""
echo "**Summary:** ${TESTS_PASSED}/${total} passed in ${total_time}ms"
echo ""