ds-sfcoe-ailabs
Version:
AI-powered code review tool with static analysis integration for comprehensive code quality assessment.
30 lines (29 loc) • 985 B
TypeScript
/**
* @fileoverview Common type definitions for file processing and code analysis
* Provides shared types used across the AI PR Review system
*/
import type { ReviewHint } from '../aiProvider/index.js';
/**
* Represents the context and metadata for a file being analyzed
* Contains the file path, content, analysis hints, and Git status information
*
* @example
* ```typescript
* const fileContext: FileContext = {
* file: 'src/MyClass.cls',
* content: 'public class MyClass { ... }',
* hints: [{ ruleId: 'SF_SOQL_IN_LOOP', message: 'SOQL in loop detected' }],
* fileStatus: 'M'
* };
* ```
*/
export type FileContext = {
/** The file path relative to the repository root */
file: string;
/** The complete file content as a string */
content: string;
/** Array of review hints/issues found in the file */
hints: ReviewHint[];
/** Git status indicator - 'A'=added, 'M'=modified, 'D'=deleted, 'R'=renamed */
fileStatus?: string;
};