Skip to content

Commit 010b7e3

Browse files
alpslaclaude
andcommitted
fix(lint): Fix remaining ESLint errors in agents package
- scan-fix-executor.ts: Remove unnecessary escape chars in regex - python-tool-parser.ts: Add braces to case block, use import instead of require - v9-analysis-pipeline.ts: Add braces to default case, add comment to empty function Lint: ✅ 0 errors (2077 warnings pre-existing) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c2fd3f4 commit 010b7e3

9 files changed

Lines changed: 15 additions & 13 deletions

File tree

packages/agents/src/fix-agent/infrastructure/supabase/framework-pattern-storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ export class FrameworkPatternStorage {
404404
async recordPatternApplication(
405405
patternId: string,
406406
success: boolean,
407-
reverted: boolean = false
407+
reverted = false
408408
): Promise<void> {
409409
await this.initialize();
410410

packages/agents/src/fix-agent/scan-fix-executor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ const AI_ERROR_PATTERNS: RegExp[] = [
241241
*/
242242
const VALID_CODE_INDICATORS: RegExp[] = [
243243
/^(?:import|from|const|let|var|function|class|def|async|export|return)\s/m, // Code keywords at line start
244-
/[{}\[\]();]/, // Contains common code syntax
244+
/[{}[\]();]/, // Contains common code syntax
245245
/=\s*[^=]/, // Assignment (not comparison)
246246
/\.\w+\(/, // Method calls
247247
];
@@ -283,7 +283,7 @@ export function validatePatternTemplate(
283283
if (codeToCheck.length > 50 && !hasCodeIndicators) {
284284
// Check if it's mostly natural language (high letter-to-symbol ratio)
285285
const letters = (codeToCheck.match(/[a-zA-Z]/g) || []).length;
286-
const symbols = (codeToCheck.match(/[{}\[\]();=<>]/g) || []).length;
286+
const symbols = (codeToCheck.match(/[{}[\]();=<>]/g) || []).length;
287287
const ratio = symbols > 0 ? letters / symbols : letters;
288288

289289
if (ratio > 20) { // Very high letter-to-symbol ratio = likely prose

packages/agents/src/fix-agent/tool-fixers/dependency-fixer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ export class DependencyFixerExecutor extends ToolExecutorBase {
433433
parseVulnerabilityFromMessage(
434434
message: string,
435435
rule: string,
436-
severity: string = 'medium'
436+
severity = 'medium'
437437
): DependencyVulnerability | null {
438438
// Try to extract package name from various formats
439439
let packageName: string | null = null;

packages/agents/src/fix-agent/tool-fixers/python-fixer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ export function isPythonVulnerabilityAutoFixable(tool: string, rule: string): bo
504504
export function parsePythonVulnerabilityFromMessage(
505505
message: string,
506506
rule: string,
507-
severity: string = 'medium'
507+
severity = 'medium'
508508
): PipAuditVulnerability | null {
509509
// Try to extract package name from message
510510
// Format: "package-name has vulnerability CVE-2023-xxxx"

packages/agents/src/two-branch/parsers/python-tool-parser.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
import { exec as execCallback } from 'child_process';
12+
import { existsSync } from 'fs';
1213
import { promisify } from 'util';
1314

1415
const exec = promisify(execCallback);
@@ -793,12 +794,13 @@ export class PythonToolParser {
793794

794795
const prefix = code.charAt(0);
795796
switch (prefix) {
796-
case 'S': // Security rules - always high/critical
797+
case 'S': { // Security rules - always high/critical
797798
// S1xx = low, S2xx = medium, S3xx-S7xx = high
798799
const secNum = parseInt(code.substring(1));
799800
if (secNum >= 300) return 'high';
800801
if (secNum >= 200) return 'medium';
801802
return 'low';
803+
}
802804
case 'E': // Errors
803805
return 'high';
804806
case 'F': // Pyflakes (undefined names, etc.)
@@ -834,8 +836,7 @@ export class PythonToolParser {
834836
// When vulnerabilities found, exits with code 1 but stdout still contains JSON
835837
// Try requirements.txt first, fallback to environment scan
836838
const requirementsTxt = `${repoPath}/requirements.txt`;
837-
const fs = require('fs');
838-
const command = fs.existsSync(requirementsTxt)
839+
const command = existsSync(requirementsTxt)
839840
? `cd ${repoPath} && pip-audit --format json -r requirements.txt`
840841
: `cd ${repoPath} && pip-audit --format json`;
841842

packages/agents/src/two-branch/report/business-impact.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function getPreCommitHookRecommendation(language: string): string {
161161
* Includes financial impact, risk assessment, and recommendations
162162
* SESSION 50 FIX: Added language parameter for language-specific recommendations
163163
*/
164-
export function generateBusinessImpact(issues: EnrichedIssue[], groups: IssueGroup[], language: string = 'java'): string {
164+
export function generateBusinessImpact(issues: EnrichedIssue[], groups: IssueGroup[], language = 'java'): string {
165165
// BLOCKERS ONLY: NEW/EXISTING_MODIFIED + critical/high
166166
const blocking = issues.filter(i =>
167167
(i.category === 'NEW' || i.category === 'EXISTING_MODIFIED') &&

packages/agents/src/two-branch/services/v9-analysis-pipeline.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,15 @@ async function getToolOrchestrator(language: SupportedLanguage): Promise<ToolOrc
181181
case 'rust':
182182
case 'ruby':
183183
case 'php':
184-
default:
184+
default: {
185185
// For languages without specialized orchestrator or patterns,
186186
// warn and use TypeScript orchestrator as fallback
187187
// TODO: Create language-specific orchestrators and calibrate patterns
188188
console.warn(`[Pipeline] Language '${language}' not yet calibrated. Using TypeScript orchestrator as fallback.`);
189189
console.warn(`[Pipeline] To add support: 1) Create orchestrator 2) Run pattern calibration`);
190190
const { TypeScriptToolOrchestrator } = await import('../tools/typescript/typescript-tool-orchestrator');
191191
return new TypeScriptToolOrchestrator();
192+
}
192193
}
193194
}
194195

@@ -359,7 +360,7 @@ export class V9AnalysisPipeline {
359360
// maxIssuesToFix is only set explicitly for testing
360361
mainBranchPath: '',
361362
prMetadata: {},
362-
onProgress: () => {},
363+
onProgress: () => { /* Default no-op progress handler */ },
363364
verbose: false,
364365
...config,
365366
};

packages/agents/src/two-branch/tools/universal/codeql-runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ export class CodeQLRunner extends UniversalToolBase {
272272
private sarifPath: string;
273273
private codeqlConfig: Required<CodeQLConfig>;
274274
private sourceHash: string | null = null;
275-
private useDocker: boolean = false; // ARM64 Docker execution mode
275+
private useDocker = false; // ARM64 Docker execution mode
276276

277277
constructor(workspacePath: string, language: string, config: CodeQLConfig = {}) {
278278
// Merge with defaults (user config overrides defaults)

packages/agents/src/two-branch/tools/universal/dependency-check-runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class UniversalDependencyCheckRunner extends UniversalToolBase {
7979
private pgDatabase: string;
8080
private pgUser: string;
8181
private pgPassword: string;
82-
private dependencyCheckPath: string = 'dependency-check.sh'; // Default to PATH lookup
82+
private dependencyCheckPath = 'dependency-check.sh'; // Default to PATH lookup
8383

8484
/**
8585
* Find dependency-check.sh in common installation locations

0 commit comments

Comments
 (0)