Skip to content
Open
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
30 changes: 27 additions & 3 deletions .github/workflows/prettier-fix.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Auto Prettier Fix
name: Formatting

on:
push:
Expand All @@ -7,13 +7,37 @@ on:
branches: [main]

permissions:
contents: write
contents: read

jobs:
prettier-check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: Check Code Formatting
defaults:
run:
working-directory: mcpjam-inspector

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"

- name: Install dependencies
run: npm ci

- name: Check formatting
run: npx prettier --check .
Comment on lines +29 to +33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

pkg="mcpjam-inspector/package.json"

echo "== scripts.prettier-fix =="
jq -r '.scripts["prettier-fix"] // "MISSING"' "$pkg"

echo
echo "== declared prettier dependency =="
jq -r '.devDependencies.prettier // .dependencies.prettier // "MISSING"' "$pkg"

Repository: MCPJam/inspector

Length of output: 149


🏁 Script executed:

cat -n .github/workflows/prettier-fix.yml

Repository: MCPJam/inspector

Length of output: 1942


Add prettier to mcpjam-inspector/package.json devDependencies.

The workflow uses npx prettier in the check job (line 33), which downloads prettier dynamically and works. However, the fix job (line 61) runs npm run prettier-fix, which invokes the script prettier --write .. This will fail because npm ci installed dependencies from an incomplete package.json that doesn't declare prettier. Add prettier as a dev dependency to ensure both jobs use the same repo-pinned formatter version.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/prettier-fix.yml around lines 29 - 33, Add prettier to
mcpjam-inspector's devDependencies in package.json so the CI fix job can run the
repo-pinned formatter; update package.json's "devDependencies" to include
"prettier" (matching the version used by the workflow or desired pinned version)
so the existing npm script that runs "prettier --write ." (invoked by the "npm
run prettier-fix" job) succeeds after npm ci installs packages.


prettier-fix:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
if: github.event_name == 'push'
runs-on: ubuntu-latest
name: Auto-fix Formatting
permissions:
contents: write
defaults:
run:
working-directory: mcpjam-inspector
Expand Down
Loading