diff --git a/.github/workflows/super-linter-report.md b/.github/workflows/super-linter-report.md index 350277b..16a85be 100644 --- a/.github/workflows/super-linter-report.md +++ b/.github/workflows/super-linter-report.md @@ -2,13 +2,13 @@ on: workflow_dispatch: schedule: - - cron: "0 14 * * 1-5" # 2 PM UTC, weekdays only + - cron: '0 14 * * 1-5' # 2 PM UTC, weekdays only permissions: contents: read actions: read safe-outputs: create-issue: - title-prefix: "[linter] " + title-prefix: '[linter] ' labels: [automation, code-quality] engine: copilot name: Super Linter Report @@ -18,16 +18,16 @@ steps: uses: actions/checkout@v5 with: fetch-depth: 0 - + - name: Setup Node.js uses: actions/setup-node@v6 with: node-version-file: .node-version cache: npm - + - name: Install Dependencies run: npm ci - + - name: Run Super Linter id: super-linter continue-on-error: true @@ -40,16 +40,16 @@ steps: LINTER_RULES_PATH: . VALIDATE_ALL_CODEBASE: true # Disable linters that are covered by other workflows or not applicable - VALIDATE_BIOME_FORMAT: false # Prettier is used instead - VALIDATE_BIOME_LINT: false # ESLint is used instead - VALIDATE_GITHUB_ACTIONS_ZIZMOR: false # Separate security workflow - VALIDATE_JAVASCRIPT_ES: false # ESLint handles JS/TS linting - VALIDATE_JSCPD: false # Copy-paste detection not required - VALIDATE_TYPESCRIPT_ES: false # ESLint handles TypeScript - VALIDATE_JSON: false # Not strictly enforced in this project + VALIDATE_BIOME_FORMAT: false # Prettier is used instead + VALIDATE_BIOME_LINT: false # ESLint is used instead + VALIDATE_GITHUB_ACTIONS_ZIZMOR: false # Separate security workflow + VALIDATE_JAVASCRIPT_ES: false # ESLint handles JS/TS linting + VALIDATE_JSCPD: false # Copy-paste detection not required + VALIDATE_TYPESCRIPT_ES: false # ESLint handles TypeScript + VALIDATE_JSON: false # Not strictly enforced in this project LOG_FILE: super-linter.log CREATE_LOG_FILE: true - + - name: Save Linter Output if: always() run: | @@ -59,7 +59,7 @@ steps: else echo "No super-linter.log file found" > /tmp/gh-aw/linter-output.txt fi - + # Also capture GitHub step summary if available if [ -n "$GITHUB_STEP_SUMMARY" ]; then echo "" >> /tmp/gh-aw/linter-output.txt @@ -73,7 +73,8 @@ tools: # Super Linter Analysis Report -You are an expert code quality analyst. Your task is to analyze the super-linter output and create a comprehensive issue report. +You are an expert code quality analyst. Your task is to analyze the super-linter +output and create a comprehensive issue report. ## Context @@ -83,7 +84,8 @@ You are an expert code quality analyst. Your task is to analyze the super-linter ## Your Task -1. **Read the linter output** from `/tmp/gh-aw/linter-output.txt` using the bash tool +1. **Read the linter output** from `/tmp/gh-aw/linter-output.txt` using the bash + tool 2. **Analyze the findings**: - Categorize errors by severity (critical, high, medium, low) - Group errors by file or linter type @@ -92,6 +94,7 @@ You are an expert code quality analyst. Your task is to analyze the super-linter 3. **Create a detailed issue** with the following structure: ### Issue Title + Use format: "Code Quality Report - [Date] - [X] issues found" ### Issue Body Structure @@ -99,20 +102,20 @@ Use format: "Code Quality Report - [Date] - [X] issues found" ```markdown ## 🔍 Super Linter Analysis Summary -**Date**: [Current date] -**Total Issues Found**: [Number] -**Run ID**: ${{ github.run_id }} +**Date**: [Current date] **Total Issues Found**: [Number] **Run ID**: +${{ github.run_id }} ## 📊 Breakdown by Severity - **Critical**: [Count and brief description] -- **High**: [Count and brief description] +- **High**: [Count and brief description] - **Medium**: [Count and brief description] - **Low**: [Count and brief description] ## 📁 Issues by Category ### [Category/Linter Name] + - **File**: `path/to/file` - Line [X]: [Error description] - Impact: [Why this matters] @@ -130,9 +133,10 @@ Use format: "Code Quality Report - [Date] - [X] issues found"
Click to expand complete linter log - ``` + [Include the full linter output here] + ```
@@ -154,4 +158,5 @@ Use format: "Code Quality Report - [Date] - [X] issues found" ## Security Note -Treat linter output as potentially sensitive. Do not expose credentials, API keys, or other secrets that might appear in file paths or error messages. +Treat linter output as potentially sensitive. Do not expose credentials, API +keys, or other secrets that might appear in file paths or error messages. diff --git a/.gitignore b/.gitignore index 80a8991..c896226 100644 --- a/.gitignore +++ b/.gitignore @@ -94,9 +94,6 @@ typings/ .DS_Store Thumbs.db -# Ignore built ts files -__tests__/runner/* - # IDE files .idea *.code-workspace diff --git a/eslint.config.mjs b/eslint.config.mjs index b875146..41d2bb7 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -48,6 +48,7 @@ export default [ allowDefaultProject: [ '__fixtures__/*.ts', '__tests__/*.ts', + 'src/*.test.ts', 'eslint.config.mjs', 'vitest.config.ts', 'rollup.config.ts' diff --git a/__tests__/docker.test.ts b/src/docker.test.ts similarity index 99% rename from __tests__/docker.test.ts rename to src/docker.test.ts index bbd5f1d..33a89b1 100644 --- a/__tests__/docker.test.ts +++ b/src/docker.test.ts @@ -11,9 +11,7 @@ vi.mock('child_process', () => ({ })) // Import the module being tested -const { runDockerContainer, stopDockerContainer } = await import( - '../src/docker.js' -) +const { runDockerContainer, stopDockerContainer } = await import('./docker.js') describe('docker.ts', () => { beforeEach(() => { diff --git a/__tests__/logging.test.ts b/src/logging.test.ts similarity index 98% rename from __tests__/logging.test.ts rename to src/logging.test.ts index e17ccad..64da9dc 100644 --- a/__tests__/logging.test.ts +++ b/src/logging.test.ts @@ -29,7 +29,7 @@ vi.mock('debug', () => ({ })) // Import the module being tested -const { setupDebugLogging } = await import('../src/logging.js') +const { setupDebugLogging } = await import('./logging.js') const debug = await import('debug') describe('logging.ts', () => { diff --git a/__tests__/main.test.ts b/src/main.test.ts similarity index 99% rename from __tests__/main.test.ts rename to src/main.test.ts index 098e8e6..5371c42 100644 --- a/__tests__/main.test.ts +++ b/src/main.test.ts @@ -17,12 +17,12 @@ const mockCore = { const mockStartProxy = vi.fn() vi.mock('@actions/core', () => mockCore) -vi.mock('../src/server.js', () => ({ +vi.mock('./server.js', () => ({ startProxy: mockStartProxy })) // Import the module being tested -const { run } = await import('../src/main.js') +const { run } = await import('./main.js') describe('main.ts', () => { beforeEach(() => { diff --git a/__tests__/port.test.ts b/src/port.test.ts similarity index 98% rename from __tests__/port.test.ts rename to src/port.test.ts index 82eca3c..bdd70cd 100644 --- a/__tests__/port.test.ts +++ b/src/port.test.ts @@ -20,7 +20,7 @@ vi.mock('node:net', () => ({ })) // Import the module being tested -const { findFreePort } = await import('../src/port.js') +const { findFreePort } = await import('./port.js') describe('port.ts', () => { beforeEach(() => { diff --git a/__tests__/server.test.ts b/src/server.test.ts similarity index 98% rename from __tests__/server.test.ts rename to src/server.test.ts index 8f8cd99..e3830ba 100644 --- a/__tests__/server.test.ts +++ b/src/server.test.ts @@ -68,21 +68,21 @@ vi.mock('@modelcontextprotocol/sdk/types.js', () => ({ ListToolsRequestSchema: {} })) -vi.mock('../src/port.js', () => ({ +vi.mock('./port.js', () => ({ findFreePort: mockFindFreePort })) -vi.mock('../src/docker.js', () => ({ +vi.mock('./docker.js', () => ({ runDockerContainer: mockRunDockerContainer, stopDockerContainer: mockStopDockerContainer })) -vi.mock('../src/logging.js', () => ({ +vi.mock('./logging.js', () => ({ setupDebugLogging: mockSetupDebugLogging })) // Import the module being tested -const { startProxy } = await import('../src/server.js') +const { startProxy } = await import('./server.js') describe('server.ts', () => { beforeEach(() => { diff --git a/tsconfig.json b/tsconfig.json index 8191311..e4c7887 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,12 @@ "strictNullChecks": true, "target": "ES2022" }, - "exclude": ["__fixtures__", "__tests__", "coverage", "dist", "node_modules"], + "exclude": [ + "__fixtures__", + "**/*.test.ts", + "coverage", + "dist", + "node_modules" + ], "include": ["src"] } diff --git a/vitest.config.ts b/vitest.config.ts index 873c1d4..3e2a30b 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -4,13 +4,13 @@ export default defineConfig({ test: { globals: true, environment: 'node', - include: ['__tests__/**/*.test.ts'], + include: ['src/**/*.test.ts'], exclude: ['**/node_modules/**', '**/dist/**'], coverage: { provider: 'v8', reporter: ['json-summary', 'text', 'lcov'], include: ['src/**'], - exclude: ['node_modules/', 'dist/'] + exclude: ['node_modules/', 'dist/', 'src/**/*.test.ts'] } } })