@webpieces/dev-config 0.2.75 ā 0.2.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/architecture/executors/validate-code/executor.d.ts +14 -6
- package/architecture/executors/validate-code/executor.js +61 -37
- package/architecture/executors/validate-code/executor.js.map +1 -1
- package/architecture/executors/validate-code/executor.ts +94 -58
- package/architecture/executors/validate-code/schema.json +48 -29
- package/architecture/executors/validate-modified-files/executor.d.ts +4 -3
- package/architecture/executors/validate-modified-files/executor.js +32 -30
- package/architecture/executors/validate-modified-files/executor.js.map +1 -1
- package/architecture/executors/validate-modified-files/executor.ts +36 -33
- package/architecture/executors/validate-modified-files/schema.json +9 -4
- package/architecture/executors/validate-modified-methods/executor.d.ts +7 -6
- package/architecture/executors/validate-modified-methods/executor.js +53 -47
- package/architecture/executors/validate-modified-methods/executor.js.map +1 -1
- package/architecture/executors/validate-modified-methods/executor.ts +57 -51
- package/architecture/executors/validate-modified-methods/schema.json +10 -5
- package/architecture/executors/validate-new-methods/executor.d.ts +4 -4
- package/architecture/executors/validate-new-methods/executor.js +64 -83
- package/architecture/executors/validate-new-methods/executor.js.map +1 -1
- package/architecture/executors/validate-new-methods/executor.ts +75 -96
- package/architecture/executors/validate-new-methods/schema.json +11 -10
- package/architecture/executors/validate-no-any-unknown/executor.d.ts +1 -2
- package/architecture/executors/validate-no-any-unknown/executor.js +57 -55
- package/architecture/executors/validate-no-any-unknown/executor.js.map +1 -1
- package/architecture/executors/validate-no-any-unknown/executor.ts +62 -57
- package/architecture/executors/validate-no-any-unknown/schema.json +2 -2
- package/architecture/executors/validate-no-inline-types/executor.d.ts +1 -2
- package/architecture/executors/validate-no-inline-types/executor.js +25 -58
- package/architecture/executors/validate-no-inline-types/executor.js.map +1 -1
- package/architecture/executors/validate-no-inline-types/executor.ts +26 -59
- package/architecture/executors/validate-no-inline-types/schema.json +2 -2
- package/architecture/executors/validate-return-types/executor.d.ts +1 -2
- package/architecture/executors/validate-return-types/executor.js +25 -58
- package/architecture/executors/validate-return-types/executor.js.map +1 -1
- package/architecture/executors/validate-return-types/executor.ts +26 -59
- package/architecture/executors/validate-return-types/schema.json +2 -2
- package/package.json +1 -1
- package/plugin.js +24 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/dev-config/architecture/executors/validate-no-inline-types/executor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;;AA8nBH,8BAkEC;;AA7rBD,iDAAyC;AACzC,+CAAyB;AACzB,mDAA6B;AAC7B,uDAAiC;AAmBjC;;GAEG;AACH,oHAAoH;AACpH,SAAS,yBAAyB,CAAC,aAAqB,EAAE,IAAY,EAAE,IAAa;IACjF,IAAI,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACnD,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,wBAAwB,UAAU,oBAAoB,EAAE;YAC5E,GAAG,EAAE,aAAa;YAClB,QAAQ,EAAE,OAAO;SACpB,CAAC,CAAC;QACH,MAAM,YAAY,GAAG,MAAM;aACtB,IAAI,EAAE;aACN,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QAE5E,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,IAAI,CAAC;gBACD,MAAM,eAAe,GAAG,IAAA,wBAAQ,EAAC,yDAAyD,EAAE;oBACxF,GAAG,EAAE,aAAa;oBAClB,QAAQ,EAAE,OAAO;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aAAa,EAAE,CAAC;YACzB,UAAU,GAAG,2BAA2B,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACtF,CAAC;aAAM,IAAI,IAAI,KAAK,0BAA0B,EAAE,CAAC;YAC7C,UAAU,GAAG,sCAAsC,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACjG,CAAC;aAAM,IAAI,IAAI,KAAK,gBAAgB,EAAE,CAAC;YACnC,UAAU,GAAG,8BAA8B,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;QAC7E,CAAC;IACL,CAAC;IAED,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAEnC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["/**\n * Validate No Inline Types Executor\n *\n * Validates that inline type literals AND tuple types are not used in type positions.\n * Prefer named types/interfaces/classes for clarity and reusability.\n *\n * ============================================================================\n * VIOLATIONS (BAD) - These patterns are flagged:\n * ============================================================================\n *\n * 1. INLINE TYPE LITERALS { }\n * -------------------------\n * - Inline parameter type: function foo(arg: { x: number }) { }\n * - Inline return type: function foo(): { x: number } { }\n * - Inline variable type: const config: { timeout: number } = { timeout: 5 };\n * - Inline property type: class C { data: { id: number }; }\n * - Inline in union: type T = { x: number } | null;\n * - Inline in intersection: type T = { x: number } & { y: number };\n * - Inline in generic: Promise<{ data: string }>\n * - Inline in array: function foo(): { id: string }[] { }\n * - Nested inline in alias: type T = { data: { nested: number } }; // inner { } flagged\n * - Inline in tuple: type T = [{ x: number }, string];\n *\n * 2. TUPLE TYPES [ ]\n * ----------------\n * - Tuple return type: function foo(): [Items[], number] { }\n * - Tuple parameter type: function foo(arg: [string, number]) { }\n * - Tuple variable type: const result: [Data[], number] = getData();\n * - Tuple in generic: Promise<[Items[], number]>\n * - Tuple in union: type T = [A, B] | null;\n * - Nested tuple: type T = { data: [A, B] };\n *\n * ============================================================================\n * ALLOWED (GOOD) - These patterns pass validation:\n * ============================================================================\n *\n * 1. TYPE ALIAS DEFINITIONS (direct body only)\n * -----------------------------------------\n * - Type alias with literal: type MyConfig = { timeout: number };\n * - Type alias with tuple: type MyResult = [Items[], number];\n * - Interface definition: interface MyData { id: number }\n * - Class definition: class UserData { id: number; name: string; }\n *\n * 2. USING NAMED TYPES\n * ------------------\n * - Named param type: function foo(arg: MyConfig) { }\n * - Named return type: function foo(): MyConfig { }\n * - Named with null: function foo(): MyConfig | null { }\n * - Named with undefined: function foo(): MyConfig | undefined { }\n * - Union of named types: type Either = TypeA | TypeB;\n * - Named in generic: Promise<MyResult>\n * - Named tuple alias: function foo(): MyTupleResult { }\n *\n * 3. PRIMITIVES AND BUILT-INS\n * -------------------------\n * - Primitive types: function foo(): string { }\n * - Primitive arrays: function foo(): string[] { }\n * - Built-in generics: function foo(): Promise<string> { }\n * - Void return: function foo(): void { }\n *\n * ============================================================================\n * MODES\n * ============================================================================\n * - OFF: Skip validation entirely\n * - NEW_METHODS: Only validate in new methods (detected via git diff)\n * - MODIFIED_AND_NEW_METHODS: Validate in new methods + methods with changes\n * - MODIFIED_FILES: Validate all violations in modified files\n * - ALL: Validate all violations in all TypeScript files\n *\n * ============================================================================\n * ESCAPE HATCH\n * ============================================================================\n * Add comment above the violation:\n * // webpieces-disable no-inline-types -- [your justification]\n * function foo(arg: { x: number }) { }\n *\n * Use sparingly! Common valid reasons:\n * - Prisma payload types that require inline generics\n * - Third-party library APIs that expect inline types\n * - Legacy code being incrementally migrated\n */\n\nimport type { ExecutorContext } from '@nx/devkit';\nimport { execSync } from 'child_process';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as ts from 'typescript';\n\nexport type NoInlineTypesMode = 'OFF' | 'NEW_METHODS' | 'MODIFIED_AND_NEW_METHODS' | 'MODIFIED_FILES' | 'ALL';\n\nexport interface ValidateNoInlineTypesOptions {\n mode?: NoInlineTypesMode;\n}\n\nexport interface ExecutorResult {\n success: boolean;\n}\n\ninterface InlineTypeViolation {\n file: string;\n line: number;\n column: number;\n context: string;\n}\n\n/**\n * Get changed TypeScript files between base and head (or working tree if head not specified).\n */\n// webpieces-disable max-lines-new-methods -- Git command handling with untracked files requires multiple code paths\nfunction getChangedTypeScriptFiles(workspaceRoot: string, base: string, head?: string): string[] {\n try {\n const diffTarget = head ? `${base} ${head}` : base;\n const output = execSync(`git diff --name-only ${diffTarget} -- '*.ts' '*.tsx'`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n });\n const changedFiles = output\n .trim()\n .split('\\n')\n .filter((f) => f && !f.includes('.spec.ts') && !f.includes('.test.ts'));\n\n if (!head) {\n try {\n const untrackedOutput = execSync(`git ls-files --others --exclude-standard '*.ts' '*.tsx'`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n });\n const untrackedFiles = untrackedOutput\n .trim()\n .split('\\n')\n .filter((f) => f && !f.includes('.spec.ts') && !f.includes('.test.ts'));\n const allFiles = new Set([...changedFiles, ...untrackedFiles]);\n return Array.from(allFiles);\n } catch {\n return changedFiles;\n }\n }\n\n return changedFiles;\n } catch {\n return [];\n }\n}\n\n/**\n * Get all TypeScript files in the workspace using git ls-files (excluding tests).\n */\nfunction getAllTypeScriptFiles(workspaceRoot: string): string[] {\n try {\n const output = execSync(`git ls-files '*.ts' '*.tsx'`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n });\n return output\n .trim()\n .split('\\n')\n .filter((f) => f && !f.includes('.spec.ts') && !f.includes('.test.ts'));\n } catch {\n return [];\n }\n}\n\n/**\n * Get the diff content for a specific file.\n */\nfunction getFileDiff(workspaceRoot: string, file: string, base: string, head?: string): string {\n try {\n const diffTarget = head ? `${base} ${head}` : base;\n const diff = execSync(`git diff ${diffTarget} -- \"${file}\"`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n });\n\n if (!diff && !head) {\n const fullPath = path.join(workspaceRoot, file);\n if (fs.existsSync(fullPath)) {\n const isUntracked = execSync(`git ls-files --others --exclude-standard \"${file}\"`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n }).trim();\n\n if (isUntracked) {\n const content = fs.readFileSync(fullPath, 'utf-8');\n const lines = content.split('\\n');\n return lines.map((line) => `+${line}`).join('\\n');\n }\n }\n }\n\n return diff;\n } catch {\n return '';\n }\n}\n\n/**\n * Parse diff to extract changed line numbers (both additions and modifications).\n */\nfunction getChangedLineNumbers(diffContent: string): Set<number> {\n const changedLines = new Set<number>();\n const lines = diffContent.split('\\n');\n let currentLine = 0;\n\n for (const line of lines) {\n const hunkMatch = line.match(/^@@ -\\d+(?:,\\d+)? \\+(\\d+)(?:,\\d+)? @@/);\n if (hunkMatch) {\n currentLine = parseInt(hunkMatch[1], 10);\n continue;\n }\n\n if (line.startsWith('+') && !line.startsWith('+++')) {\n changedLines.add(currentLine);\n currentLine++;\n } else if (line.startsWith('-') && !line.startsWith('---')) {\n // Deletions don't increment line number\n } else {\n currentLine++;\n }\n }\n\n return changedLines;\n}\n\n/**\n * Check if a line contains a webpieces-disable comment for no-inline-types.\n */\nfunction hasDisableComment(lines: string[], lineNumber: number): boolean {\n const startCheck = Math.max(0, lineNumber - 5);\n for (let i = lineNumber - 2; i >= startCheck; i--) {\n const line = lines[i]?.trim() ?? '';\n if (line.startsWith('function ') || line.startsWith('class ') || line.endsWith('}')) {\n break;\n }\n if (line.includes('webpieces-disable') && line.includes('no-inline-types')) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Check if a TypeLiteral or TupleType node is in an allowed context.\n * Only allowed if the DIRECT parent is a TypeAliasDeclaration.\n *\n * ALLOWED:\n * type MyConfig = { x: number }; // TypeLiteral direct child of TypeAliasDeclaration\n * type MyTuple = [A, B]; // TupleType direct child of TypeAliasDeclaration\n *\n * NOT ALLOWED (flagged):\n * type T = { x: number } | null; // Parent is UnionType, not TypeAliasDeclaration\n * type T = { data: { nested: number } }; // Inner TypeLiteral's parent is PropertySignature\n * function foo(): [A, B] { } // TupleType's parent is FunctionDeclaration\n * type T = Prisma.GetPayload<{ include: {...} }>; // TypeLiteral in generic argument\n *\n * NOTE: Prisma types require inline type literals in generic arguments. Use the escape hatch:\n * // webpieces-disable no-inline-types -- Prisma API requires inline type argument\n * type T = Prisma.GetPayload<{ include: {...} }>;\n */\nfunction isInAllowedContext(node: ts.TypeLiteralNode | ts.TupleTypeNode): boolean {\n const parent = node.parent;\n if (!parent) return false;\n\n // Only allowed if it's the DIRECT body of a type alias\n if (ts.isTypeAliasDeclaration(parent)) {\n return true;\n }\n return false;\n}\n\n/**\n * Get a description of the context where the inline type or tuple appears.\n *\n * Returns human-readable context like:\n * - \"inline parameter type\"\n * - \"tuple return type\"\n * - \"inline type in generic argument\"\n */\n// webpieces-disable max-lines-new-methods -- Context detection requires checking many AST node types\nfunction getViolationContext(node: ts.TypeLiteralNode | ts.TupleTypeNode, sourceFile: ts.SourceFile): string {\n try {\n const isTuple = ts.isTupleTypeNode(node);\n const prefix = isTuple ? 'tuple' : 'inline';\n\n let current: ts.Node = node;\n while (current.parent) {\n const parent = current.parent;\n if (ts.isParameter(parent)) {\n return `${prefix} parameter type`;\n }\n if (ts.isFunctionDeclaration(parent) || ts.isMethodDeclaration(parent) || ts.isArrowFunction(parent)) {\n if (parent.type === current) {\n return `${prefix} return type`;\n }\n }\n if (ts.isVariableDeclaration(parent)) {\n return `${prefix} variable type`;\n }\n if (ts.isPropertyDeclaration(parent) || ts.isPropertySignature(parent)) {\n if (parent.type === current) {\n return `${prefix} property type`;\n }\n // Check if it's nested inside another type literal\n let ancestor: ts.Node | undefined = parent.parent;\n while (ancestor) {\n if (ts.isTypeLiteralNode(ancestor)) {\n return `nested ${prefix} type`;\n }\n if (ts.isTypeAliasDeclaration(ancestor)) {\n return `nested ${prefix} type in type alias`;\n }\n ancestor = ancestor.parent;\n }\n }\n if (ts.isUnionTypeNode(parent) || ts.isIntersectionTypeNode(parent)) {\n return `${prefix} type in union/intersection`;\n }\n // Safely check parent.parent before accessing it\n if (parent.parent && ts.isTypeReferenceNode(parent.parent) && ts.isTypeNode(parent)) {\n return `${prefix} type in generic argument`;\n }\n // Direct parent is TypeReferenceNode (e.g., Prisma.GetPayload<{...}>)\n if (ts.isTypeReferenceNode(parent)) {\n return `${prefix} type in generic argument`;\n }\n if (ts.isArrayTypeNode(parent)) {\n return `${prefix} type in array`;\n }\n if (ts.isTupleTypeNode(parent) && !isTuple) {\n return `inline type in tuple`;\n }\n current = parent;\n }\n return isTuple ? 'tuple type' : 'inline type literal';\n } catch (error) {\n // Defensive: return generic context if AST traversal fails\n return ts.isTupleTypeNode(node) ? 'tuple type' : 'inline type literal';\n }\n}\n\ninterface MethodInfo {\n name: string;\n startLine: number;\n endLine: number;\n}\n\n/**\n * Find all methods/functions in a file with their line ranges.\n */\n// webpieces-disable max-lines-new-methods -- AST traversal requires inline visitor function\nfunction findMethodsInFile(filePath: string, workspaceRoot: string): MethodInfo[] {\n const fullPath = path.join(workspaceRoot, filePath);\n if (!fs.existsSync(fullPath)) return [];\n\n const content = fs.readFileSync(fullPath, 'utf-8');\n const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);\n\n const methods: MethodInfo[] = [];\n\n // webpieces-disable max-lines-new-methods -- AST visitor pattern requires handling multiple node types\n function visit(node: ts.Node): void {\n let methodName: string | undefined;\n let startLine: number | undefined;\n let endLine: number | undefined;\n\n if (ts.isMethodDeclaration(node) && node.name) {\n methodName = node.name.getText(sourceFile);\n const start = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const end = sourceFile.getLineAndCharacterOfPosition(node.getEnd());\n startLine = start.line + 1;\n endLine = end.line + 1;\n } else if (ts.isFunctionDeclaration(node) && node.name) {\n methodName = node.name.getText(sourceFile);\n const start = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const end = sourceFile.getLineAndCharacterOfPosition(node.getEnd());\n startLine = start.line + 1;\n endLine = end.line + 1;\n } else if (ts.isArrowFunction(node)) {\n if (ts.isVariableDeclaration(node.parent) && ts.isIdentifier(node.parent.name)) {\n methodName = node.parent.name.getText(sourceFile);\n const start = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const end = sourceFile.getLineAndCharacterOfPosition(node.getEnd());\n startLine = start.line + 1;\n endLine = end.line + 1;\n }\n }\n\n if (methodName && startLine !== undefined && endLine !== undefined) {\n methods.push({ name: methodName, startLine, endLine });\n }\n\n ts.forEachChild(node, visit);\n }\n\n visit(sourceFile);\n return methods;\n}\n\n/**\n * Check if a line is within any method's range and if that method has changes.\n */\nfunction isLineInChangedMethod(\n line: number,\n methods: MethodInfo[],\n changedLines: Set<number>,\n newMethodNames: Set<string>\n): boolean {\n for (const method of methods) {\n if (line >= method.startLine && line <= method.endLine) {\n // Check if this method is new or has changes\n if (newMethodNames.has(method.name)) {\n return true;\n }\n // Check if any line in the method range has changes\n for (let l = method.startLine; l <= method.endLine; l++) {\n if (changedLines.has(l)) {\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/**\n * Check if a line is within a new method.\n */\nfunction isLineInNewMethod(line: number, methods: MethodInfo[], newMethodNames: Set<string>): boolean {\n for (const method of methods) {\n if (line >= method.startLine && line <= method.endLine && newMethodNames.has(method.name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Parse diff to find newly added method signatures.\n */\nfunction findNewMethodSignaturesInDiff(diffContent: string): Set<string> {\n const newMethods = new Set<string>();\n const lines = diffContent.split('\\n');\n\n const patterns = [\n /^\\+\\s*(?:export\\s+)?(?:async\\s+)?function\\s+(\\w+)\\s*\\(/,\n /^\\+\\s*(?:export\\s+)?(?:const|let)\\s+(\\w+)\\s*=\\s*(?:async\\s*)?\\(/,\n /^\\+\\s*(?:export\\s+)?(?:const|let)\\s+(\\w+)\\s*=\\s*(?:async\\s+)?function/,\n /^\\+\\s*(?:(?:public|private|protected)\\s+)?(?:static\\s+)?(?:async\\s+)?(\\w+)\\s*\\(/,\n ];\n\n for (const line of lines) {\n if (line.startsWith('+') && !line.startsWith('+++')) {\n for (const pattern of patterns) {\n const match = line.match(pattern);\n if (match) {\n const methodName = match[1];\n if (methodName && !['if', 'for', 'while', 'switch', 'catch', 'constructor'].includes(methodName)) {\n newMethods.add(methodName);\n }\n break;\n }\n }\n }\n }\n\n return newMethods;\n}\n\ninterface InlineTypeInfo {\n line: number;\n column: number;\n context: string;\n hasDisableComment: boolean;\n}\n\n/**\n * Find all inline type literals AND tuple types in a file.\n *\n * Detects:\n * - TypeLiteral nodes: { x: number }\n * - TupleType nodes: [A, B]\n *\n * Both are flagged unless they are the DIRECT body of a type alias.\n */\n// webpieces-disable max-lines-new-methods -- AST traversal with visitor pattern\nfunction findInlineTypesInFile(filePath: string, workspaceRoot: string): InlineTypeInfo[] {\n const fullPath = path.join(workspaceRoot, filePath);\n if (!fs.existsSync(fullPath)) return [];\n\n const content = fs.readFileSync(fullPath, 'utf-8');\n const fileLines = content.split('\\n');\n const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);\n\n const inlineTypes: InlineTypeInfo[] = [];\n\n function visit(node: ts.Node): void {\n try {\n // Check for inline type literals: { x: number }\n if (ts.isTypeLiteralNode(node)) {\n if (!isInAllowedContext(node)) {\n const startPos = node.getStart(sourceFile);\n if (startPos >= 0) {\n const pos = sourceFile.getLineAndCharacterOfPosition(startPos);\n const line = pos.line + 1;\n const column = pos.character + 1;\n const context = getViolationContext(node, sourceFile);\n const disabled = hasDisableComment(fileLines, line);\n\n inlineTypes.push({\n line,\n column,\n context,\n hasDisableComment: disabled,\n });\n }\n }\n }\n\n // Check for tuple types: [A, B]\n if (ts.isTupleTypeNode(node)) {\n if (!isInAllowedContext(node)) {\n const startPos = node.getStart(sourceFile);\n if (startPos >= 0) {\n const pos = sourceFile.getLineAndCharacterOfPosition(startPos);\n const line = pos.line + 1;\n const column = pos.character + 1;\n const context = getViolationContext(node, sourceFile);\n const disabled = hasDisableComment(fileLines, line);\n\n inlineTypes.push({\n line,\n column,\n context,\n hasDisableComment: disabled,\n });\n }\n }\n }\n } catch (error) {\n // Skip nodes that cause errors during analysis\n }\n\n ts.forEachChild(node, visit);\n }\n\n visit(sourceFile);\n return inlineTypes;\n}\n\n/**\n * Find violations in new methods only (NEW_METHODS mode).\n */\n// webpieces-disable max-lines-new-methods -- File iteration with diff parsing and method matching\nfunction findViolationsForNewMethods(\n workspaceRoot: string,\n changedFiles: string[],\n base: string,\n head?: string\n): InlineTypeViolation[] {\n const violations: InlineTypeViolation[] = [];\n\n for (const file of changedFiles) {\n const diff = getFileDiff(workspaceRoot, file, base, head);\n const newMethodNames = findNewMethodSignaturesInDiff(diff);\n\n if (newMethodNames.size === 0) continue;\n\n const methods = findMethodsInFile(file, workspaceRoot);\n const inlineTypes = findInlineTypesInFile(file, workspaceRoot);\n\n for (const inlineType of inlineTypes) {\n if (inlineType.hasDisableComment) continue;\n if (!isLineInNewMethod(inlineType.line, methods, newMethodNames)) continue;\n\n violations.push({\n file,\n line: inlineType.line,\n column: inlineType.column,\n context: inlineType.context,\n });\n }\n }\n\n return violations;\n}\n\n/**\n * Find violations in new and modified methods (MODIFIED_AND_NEW_METHODS mode).\n */\n// webpieces-disable max-lines-new-methods -- Combines new method detection with change detection\nfunction findViolationsForModifiedAndNewMethods(\n workspaceRoot: string,\n changedFiles: string[],\n base: string,\n head?: string\n): InlineTypeViolation[] {\n const violations: InlineTypeViolation[] = [];\n\n for (const file of changedFiles) {\n const diff = getFileDiff(workspaceRoot, file, base, head);\n const newMethodNames = findNewMethodSignaturesInDiff(diff);\n const changedLines = getChangedLineNumbers(diff);\n\n const methods = findMethodsInFile(file, workspaceRoot);\n const inlineTypes = findInlineTypesInFile(file, workspaceRoot);\n\n for (const inlineType of inlineTypes) {\n if (inlineType.hasDisableComment) continue;\n if (!isLineInChangedMethod(inlineType.line, methods, changedLines, newMethodNames)) continue;\n\n violations.push({\n file,\n line: inlineType.line,\n column: inlineType.column,\n context: inlineType.context,\n });\n }\n }\n\n return violations;\n}\n\n/**\n * Find all violations in modified files (MODIFIED_FILES mode).\n */\nfunction findViolationsForModifiedFiles(workspaceRoot: string, changedFiles: string[]): InlineTypeViolation[] {\n const violations: InlineTypeViolation[] = [];\n\n for (const file of changedFiles) {\n const inlineTypes = findInlineTypesInFile(file, workspaceRoot);\n\n for (const inlineType of inlineTypes) {\n if (inlineType.hasDisableComment) continue;\n\n violations.push({\n file,\n line: inlineType.line,\n column: inlineType.column,\n context: inlineType.context,\n });\n }\n }\n\n return violations;\n}\n\n/**\n * Find all violations in all files (ALL mode).\n */\nfunction findViolationsForAll(workspaceRoot: string): InlineTypeViolation[] {\n const allFiles = getAllTypeScriptFiles(workspaceRoot);\n return findViolationsForModifiedFiles(workspaceRoot, allFiles);\n}\n\n/**\n * Auto-detect the base branch by finding the merge-base with origin/main.\n */\nfunction detectBase(workspaceRoot: string): string | null {\n try {\n const mergeBase = execSync('git merge-base HEAD origin/main', {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n }).trim();\n\n if (mergeBase) {\n return mergeBase;\n }\n } catch {\n try {\n const mergeBase = execSync('git merge-base HEAD main', {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n }).trim();\n\n if (mergeBase) {\n return mergeBase;\n }\n } catch {\n // Ignore\n }\n }\n return null;\n}\n\n/**\n * Report violations to console.\n */\nfunction reportViolations(violations: InlineTypeViolation[], mode: NoInlineTypesMode): void {\n console.error('');\n console.error('ā Inline type literals found! Use named types instead.');\n console.error('');\n console.error('š Named types improve code clarity and reusability:');\n console.error('');\n console.error(' BAD: function foo(arg: { x: number }) { }');\n console.error(' GOOD: type MyConfig = { x: number };');\n console.error(' function foo(arg: MyConfig) { }');\n console.error('');\n console.error(' BAD: type Nullable = { x: number } | null;');\n console.error(' GOOD: type MyData = { x: number };');\n console.error(' type Nullable = MyData | null;');\n console.error('');\n\n for (const v of violations) {\n console.error(` ā ${v.file}:${v.line}:${v.column}`);\n console.error(` ${v.context}`);\n }\n console.error('');\n\n console.error(' To fix: Extract inline types to named type aliases or interfaces');\n console.error('');\n console.error(' Escape hatch (use sparingly):');\n console.error(' // webpieces-disable no-inline-types -- [your reason]');\n console.error('');\n console.error(` Current mode: ${mode}`);\n console.error('');\n}\n\nexport default async function runExecutor(\n options: ValidateNoInlineTypesOptions,\n context: ExecutorContext\n): Promise<ExecutorResult> {\n const workspaceRoot = context.root;\n const mode: NoInlineTypesMode = options.mode ?? 'OFF';\n\n if (mode === 'OFF') {\n console.log('\\nāļø Skipping no-inline-types validation (mode: OFF)');\n console.log('');\n return { success: true };\n }\n\n console.log('\\nš Validating No Inline Types\\n');\n console.log(` Mode: ${mode}`);\n\n let violations: InlineTypeViolation[] = [];\n\n if (mode === 'ALL') {\n console.log(' Scope: All tracked TypeScript files');\n console.log('');\n violations = findViolationsForAll(workspaceRoot);\n } else {\n let base = process.env['NX_BASE'];\n const head = process.env['NX_HEAD'];\n\n if (!base) {\n base = detectBase(workspaceRoot) ?? undefined;\n\n if (!base) {\n console.log('\\nāļø Skipping no-inline-types validation (could not detect base branch)');\n console.log('');\n return { success: true };\n }\n }\n\n console.log(` Base: ${base}`);\n console.log(` Head: ${head ?? 'working tree (includes uncommitted changes)'}`);\n console.log('');\n\n const changedFiles = getChangedTypeScriptFiles(workspaceRoot, base, head);\n\n if (changedFiles.length === 0) {\n console.log('ā
No TypeScript files changed');\n return { success: true };\n }\n\n console.log(`š Checking ${changedFiles.length} changed file(s)...`);\n\n if (mode === 'NEW_METHODS') {\n violations = findViolationsForNewMethods(workspaceRoot, changedFiles, base, head);\n } else if (mode === 'MODIFIED_AND_NEW_METHODS') {\n violations = findViolationsForModifiedAndNewMethods(workspaceRoot, changedFiles, base, head);\n } else if (mode === 'MODIFIED_FILES') {\n violations = findViolationsForModifiedFiles(workspaceRoot, changedFiles);\n }\n }\n\n if (violations.length === 0) {\n console.log('ā
No inline type literals found');\n return { success: true };\n }\n\n reportViolations(violations, mode);\n\n return { success: false };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/dev-config/architecture/executors/validate-no-inline-types/executor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;;AAomBH,8BA4DC;;AA7pBD,iDAAyC;AACzC,+CAAyB;AACzB,mDAA6B;AAC7B,uDAAiC;AAmBjC;;GAEG;AACH,oHAAoH;AACpH,SAAS,yBAAyB,CAAC,aAAqB,EAAE,IAAY,EAAE,IAAa;IACjF,IAAI,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACnD,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,wBAAwB,UAAU,oBAAoB,EAAE;YAC5E,GAAG,EAAE,aAAa;YAClB,QAAQ,EAAE,OAAO;SACpB,CAAC,CAAC;QACH,MAAM,YAAY,GAAG,MAAM;aACtB,IAAI,EAAE;aACN,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QAE5E,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,IAAI,CAAC;gBACD,MAAM,eAAe,GAAG,IAAA,wBAAQ,EAAC,yDAAyD,EAAE;oBACxF,GAAG,EAAE,aAAa;oBAClB,QAAQ,EAAE,OAAO;iBACpB,CAAC,CAAC;gBACH,MAAM,cAAc,GAAG,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C;IAE1E,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,eAAe,YAAY,CAAC,MAAM,qBAAqB,CAAC,CAAC;IAErE,IAAI,UAAU,GAA0B,EAAE,CAAC;IAE3C,IAAI,IAAI,KAAK,aAAa,EAAE,CAAC;QACzB,UAAU,GAAG,2BAA2B,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACtF,CAAC;SAAM,IAAI,IAAI,KAAK,0BAA0B,EAAE,CAAC;QAC7C,UAAU,GAAG,sCAAsC,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACjG,CAAC;SAAM,IAAI,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACnC,UAAU,GAAG,8BAA8B,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAEnC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["/**\n * Validate No Inline Types Executor\n *\n * Validates that inline type literals AND tuple types are not used in type positions.\n * Prefer named types/interfaces/classes for clarity and reusability.\n *\n * ============================================================================\n * VIOLATIONS (BAD) - These patterns are flagged:\n * ============================================================================\n *\n * 1. INLINE TYPE LITERALS { }\n * -------------------------\n * - Inline parameter type: function foo(arg: { x: number }) { }\n * - Inline return type: function foo(): { x: number } { }\n * - Inline variable type: const config: { timeout: number } = { timeout: 5 };\n * - Inline property type: class C { data: { id: number }; }\n * - Inline in union: type T = { x: number } | null;\n * - Inline in intersection: type T = { x: number } & { y: number };\n * - Inline in generic: Promise<{ data: string }>\n * - Inline in array: function foo(): { id: string }[] { }\n * - Nested inline in alias: type T = { data: { nested: number } }; // inner { } flagged\n * - Inline in tuple: type T = [{ x: number }, string];\n *\n * 2. TUPLE TYPES [ ]\n * ----------------\n * - Tuple return type: function foo(): [Items[], number] { }\n * - Tuple parameter type: function foo(arg: [string, number]) { }\n * - Tuple variable type: const result: [Data[], number] = getData();\n * - Tuple in generic: Promise<[Items[], number]>\n * - Tuple in union: type T = [A, B] | null;\n * - Nested tuple: type T = { data: [A, B] };\n *\n * ============================================================================\n * ALLOWED (GOOD) - These patterns pass validation:\n * ============================================================================\n *\n * 1. TYPE ALIAS DEFINITIONS (direct body only)\n * -----------------------------------------\n * - Type alias with literal: type MyConfig = { timeout: number };\n * - Type alias with tuple: type MyResult = [Items[], number];\n * - Interface definition: interface MyData { id: number }\n * - Class definition: class UserData { id: number; name: string; }\n *\n * 2. USING NAMED TYPES\n * ------------------\n * - Named param type: function foo(arg: MyConfig) { }\n * - Named return type: function foo(): MyConfig { }\n * - Named with null: function foo(): MyConfig | null { }\n * - Named with undefined: function foo(): MyConfig | undefined { }\n * - Union of named types: type Either = TypeA | TypeB;\n * - Named in generic: Promise<MyResult>\n * - Named tuple alias: function foo(): MyTupleResult { }\n *\n * 3. PRIMITIVES AND BUILT-INS\n * -------------------------\n * - Primitive types: function foo(): string { }\n * - Primitive arrays: function foo(): string[] { }\n * - Built-in generics: function foo(): Promise<string> { }\n * - Void return: function foo(): void { }\n *\n * ============================================================================\n * MODES\n * ============================================================================\n * - OFF: Skip validation entirely\n * - NEW_METHODS: Only validate in new methods (detected via git diff)\n * - MODIFIED_AND_NEW_METHODS: Validate in new methods + methods with changes\n * - MODIFIED_FILES: Validate all violations in modified files\n *\n * ============================================================================\n * ESCAPE HATCH\n * ============================================================================\n * Add comment above the violation:\n * // webpieces-disable no-inline-types -- [your justification]\n * function foo(arg: { x: number }) { }\n *\n * Use sparingly! Common valid reasons:\n * - Prisma payload types that require inline generics\n * - Third-party library APIs that expect inline types\n * - Legacy code being incrementally migrated\n */\n\nimport type { ExecutorContext } from '@nx/devkit';\nimport { execSync } from 'child_process';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as ts from 'typescript';\n\nexport type NoInlineTypesMode = 'OFF' | 'NEW_METHODS' | 'MODIFIED_AND_NEW_METHODS' | 'MODIFIED_FILES';\n\nexport interface ValidateNoInlineTypesOptions {\n mode?: NoInlineTypesMode;\n}\n\nexport interface ExecutorResult {\n success: boolean;\n}\n\ninterface InlineTypeViolation {\n file: string;\n line: number;\n column: number;\n context: string;\n}\n\n/**\n * Get changed TypeScript files between base and head (or working tree if head not specified).\n */\n// webpieces-disable max-lines-new-methods -- Git command handling with untracked files requires multiple code paths\nfunction getChangedTypeScriptFiles(workspaceRoot: string, base: string, head?: string): string[] {\n try {\n const diffTarget = head ? `${base} ${head}` : base;\n const output = execSync(`git diff --name-only ${diffTarget} -- '*.ts' '*.tsx'`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n });\n const changedFiles = output\n .trim()\n .split('\\n')\n .filter((f) => f && !f.includes('.spec.ts') && !f.includes('.test.ts'));\n\n if (!head) {\n try {\n const untrackedOutput = execSync(`git ls-files --others --exclude-standard '*.ts' '*.tsx'`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n });\n const untrackedFiles = untrackedOutput\n .trim()\n .split('\\n')\n .filter((f) => f && !f.includes('.spec.ts') && !f.includes('.test.ts'));\n const allFiles = new Set([...changedFiles, ...untrackedFiles]);\n return Array.from(allFiles);\n } catch {\n return changedFiles;\n }\n }\n\n return changedFiles;\n } catch {\n return [];\n }\n}\n\n/**\n * Get the diff content for a specific file.\n */\nfunction getFileDiff(workspaceRoot: string, file: string, base: string, head?: string): string {\n try {\n const diffTarget = head ? `${base} ${head}` : base;\n const diff = execSync(`git diff ${diffTarget} -- \"${file}\"`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n });\n\n if (!diff && !head) {\n const fullPath = path.join(workspaceRoot, file);\n if (fs.existsSync(fullPath)) {\n const isUntracked = execSync(`git ls-files --others --exclude-standard \"${file}\"`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n }).trim();\n\n if (isUntracked) {\n const content = fs.readFileSync(fullPath, 'utf-8');\n const lines = content.split('\\n');\n return lines.map((line) => `+${line}`).join('\\n');\n }\n }\n }\n\n return diff;\n } catch {\n return '';\n }\n}\n\n/**\n * Parse diff to extract changed line numbers (both additions and modifications).\n */\nfunction getChangedLineNumbers(diffContent: string): Set<number> {\n const changedLines = new Set<number>();\n const lines = diffContent.split('\\n');\n let currentLine = 0;\n\n for (const line of lines) {\n const hunkMatch = line.match(/^@@ -\\d+(?:,\\d+)? \\+(\\d+)(?:,\\d+)? @@/);\n if (hunkMatch) {\n currentLine = parseInt(hunkMatch[1], 10);\n continue;\n }\n\n if (line.startsWith('+') && !line.startsWith('+++')) {\n changedLines.add(currentLine);\n currentLine++;\n } else if (line.startsWith('-') && !line.startsWith('---')) {\n // Deletions don't increment line number\n } else {\n currentLine++;\n }\n }\n\n return changedLines;\n}\n\n/**\n * Check if a line contains a webpieces-disable comment for no-inline-types.\n */\nfunction hasDisableComment(lines: string[], lineNumber: number): boolean {\n const startCheck = Math.max(0, lineNumber - 5);\n for (let i = lineNumber - 2; i >= startCheck; i--) {\n const line = lines[i]?.trim() ?? '';\n if (line.startsWith('function ') || line.startsWith('class ') || line.endsWith('}')) {\n break;\n }\n if (line.includes('webpieces-disable') && line.includes('no-inline-types')) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Check if a TypeLiteral or TupleType node is in an allowed context.\n * Only allowed if the DIRECT parent is a TypeAliasDeclaration.\n *\n * ALLOWED:\n * type MyConfig = { x: number }; // TypeLiteral direct child of TypeAliasDeclaration\n * type MyTuple = [A, B]; // TupleType direct child of TypeAliasDeclaration\n *\n * NOT ALLOWED (flagged):\n * type T = { x: number } | null; // Parent is UnionType, not TypeAliasDeclaration\n * type T = { data: { nested: number } }; // Inner TypeLiteral's parent is PropertySignature\n * function foo(): [A, B] { } // TupleType's parent is FunctionDeclaration\n * type T = Prisma.GetPayload<{ include: {...} }>; // TypeLiteral in generic argument\n *\n * NOTE: Prisma types require inline type literals in generic arguments. Use the escape hatch:\n * // webpieces-disable no-inline-types -- Prisma API requires inline type argument\n * type T = Prisma.GetPayload<{ include: {...} }>;\n */\nfunction isInAllowedContext(node: ts.TypeLiteralNode | ts.TupleTypeNode): boolean {\n const parent = node.parent;\n if (!parent) return false;\n\n // Only allowed if it's the DIRECT body of a type alias\n if (ts.isTypeAliasDeclaration(parent)) {\n return true;\n }\n return false;\n}\n\n/**\n * Get a description of the context where the inline type or tuple appears.\n *\n * Returns human-readable context like:\n * - \"inline parameter type\"\n * - \"tuple return type\"\n * - \"inline type in generic argument\"\n */\n// webpieces-disable max-lines-new-methods -- Context detection requires checking many AST node types\nfunction getViolationContext(node: ts.TypeLiteralNode | ts.TupleTypeNode, sourceFile: ts.SourceFile): string {\n try {\n const isTuple = ts.isTupleTypeNode(node);\n const prefix = isTuple ? 'tuple' : 'inline';\n\n let current: ts.Node = node;\n while (current.parent) {\n const parent = current.parent;\n if (ts.isParameter(parent)) {\n return `${prefix} parameter type`;\n }\n if (ts.isFunctionDeclaration(parent) || ts.isMethodDeclaration(parent) || ts.isArrowFunction(parent)) {\n if (parent.type === current) {\n return `${prefix} return type`;\n }\n }\n if (ts.isVariableDeclaration(parent)) {\n return `${prefix} variable type`;\n }\n if (ts.isPropertyDeclaration(parent) || ts.isPropertySignature(parent)) {\n if (parent.type === current) {\n return `${prefix} property type`;\n }\n // Check if it's nested inside another type literal\n let ancestor: ts.Node | undefined = parent.parent;\n while (ancestor) {\n if (ts.isTypeLiteralNode(ancestor)) {\n return `nested ${prefix} type`;\n }\n if (ts.isTypeAliasDeclaration(ancestor)) {\n return `nested ${prefix} type in type alias`;\n }\n ancestor = ancestor.parent;\n }\n }\n if (ts.isUnionTypeNode(parent) || ts.isIntersectionTypeNode(parent)) {\n return `${prefix} type in union/intersection`;\n }\n // Safely check parent.parent before accessing it\n if (parent.parent && ts.isTypeReferenceNode(parent.parent) && ts.isTypeNode(parent)) {\n return `${prefix} type in generic argument`;\n }\n // Direct parent is TypeReferenceNode (e.g., Prisma.GetPayload<{...}>)\n if (ts.isTypeReferenceNode(parent)) {\n return `${prefix} type in generic argument`;\n }\n if (ts.isArrayTypeNode(parent)) {\n return `${prefix} type in array`;\n }\n if (ts.isTupleTypeNode(parent) && !isTuple) {\n return `inline type in tuple`;\n }\n current = parent;\n }\n return isTuple ? 'tuple type' : 'inline type literal';\n } catch (error) {\n // Defensive: return generic context if AST traversal fails\n return ts.isTupleTypeNode(node) ? 'tuple type' : 'inline type literal';\n }\n}\n\ninterface MethodInfo {\n name: string;\n startLine: number;\n endLine: number;\n}\n\n/**\n * Find all methods/functions in a file with their line ranges.\n */\n// webpieces-disable max-lines-new-methods -- AST traversal requires inline visitor function\nfunction findMethodsInFile(filePath: string, workspaceRoot: string): MethodInfo[] {\n const fullPath = path.join(workspaceRoot, filePath);\n if (!fs.existsSync(fullPath)) return [];\n\n const content = fs.readFileSync(fullPath, 'utf-8');\n const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);\n\n const methods: MethodInfo[] = [];\n\n // webpieces-disable max-lines-new-methods -- AST visitor pattern requires handling multiple node types\n function visit(node: ts.Node): void {\n let methodName: string | undefined;\n let startLine: number | undefined;\n let endLine: number | undefined;\n\n if (ts.isMethodDeclaration(node) && node.name) {\n methodName = node.name.getText(sourceFile);\n const start = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const end = sourceFile.getLineAndCharacterOfPosition(node.getEnd());\n startLine = start.line + 1;\n endLine = end.line + 1;\n } else if (ts.isFunctionDeclaration(node) && node.name) {\n methodName = node.name.getText(sourceFile);\n const start = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const end = sourceFile.getLineAndCharacterOfPosition(node.getEnd());\n startLine = start.line + 1;\n endLine = end.line + 1;\n } else if (ts.isArrowFunction(node)) {\n if (ts.isVariableDeclaration(node.parent) && ts.isIdentifier(node.parent.name)) {\n methodName = node.parent.name.getText(sourceFile);\n const start = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const end = sourceFile.getLineAndCharacterOfPosition(node.getEnd());\n startLine = start.line + 1;\n endLine = end.line + 1;\n }\n }\n\n if (methodName && startLine !== undefined && endLine !== undefined) {\n methods.push({ name: methodName, startLine, endLine });\n }\n\n ts.forEachChild(node, visit);\n }\n\n visit(sourceFile);\n return methods;\n}\n\n/**\n * Check if a line is within any method's range and if that method has changes.\n */\nfunction isLineInChangedMethod(\n line: number,\n methods: MethodInfo[],\n changedLines: Set<number>,\n newMethodNames: Set<string>\n): boolean {\n for (const method of methods) {\n if (line >= method.startLine && line <= method.endLine) {\n // Check if this method is new or has changes\n if (newMethodNames.has(method.name)) {\n return true;\n }\n // Check if any line in the method range has changes\n for (let l = method.startLine; l <= method.endLine; l++) {\n if (changedLines.has(l)) {\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/**\n * Check if a line is within a new method.\n */\nfunction isLineInNewMethod(line: number, methods: MethodInfo[], newMethodNames: Set<string>): boolean {\n for (const method of methods) {\n if (line >= method.startLine && line <= method.endLine && newMethodNames.has(method.name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Parse diff to find newly added method signatures.\n */\nfunction findNewMethodSignaturesInDiff(diffContent: string): Set<string> {\n const newMethods = new Set<string>();\n const lines = diffContent.split('\\n');\n\n const patterns = [\n /^\\+\\s*(?:export\\s+)?(?:async\\s+)?function\\s+(\\w+)\\s*\\(/,\n /^\\+\\s*(?:export\\s+)?(?:const|let)\\s+(\\w+)\\s*=\\s*(?:async\\s*)?\\(/,\n /^\\+\\s*(?:export\\s+)?(?:const|let)\\s+(\\w+)\\s*=\\s*(?:async\\s+)?function/,\n /^\\+\\s*(?:(?:public|private|protected)\\s+)?(?:static\\s+)?(?:async\\s+)?(\\w+)\\s*\\(/,\n ];\n\n for (const line of lines) {\n if (line.startsWith('+') && !line.startsWith('+++')) {\n for (const pattern of patterns) {\n const match = line.match(pattern);\n if (match) {\n const methodName = match[1];\n if (methodName && !['if', 'for', 'while', 'switch', 'catch', 'constructor'].includes(methodName)) {\n newMethods.add(methodName);\n }\n break;\n }\n }\n }\n }\n\n return newMethods;\n}\n\ninterface InlineTypeInfo {\n line: number;\n column: number;\n context: string;\n hasDisableComment: boolean;\n}\n\n/**\n * Find all inline type literals AND tuple types in a file.\n *\n * Detects:\n * - TypeLiteral nodes: { x: number }\n * - TupleType nodes: [A, B]\n *\n * Both are flagged unless they are the DIRECT body of a type alias.\n */\n// webpieces-disable max-lines-new-methods -- AST traversal with visitor pattern\nfunction findInlineTypesInFile(filePath: string, workspaceRoot: string): InlineTypeInfo[] {\n const fullPath = path.join(workspaceRoot, filePath);\n if (!fs.existsSync(fullPath)) return [];\n\n const content = fs.readFileSync(fullPath, 'utf-8');\n const fileLines = content.split('\\n');\n const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);\n\n const inlineTypes: InlineTypeInfo[] = [];\n\n function visit(node: ts.Node): void {\n try {\n // Check for inline type literals: { x: number }\n if (ts.isTypeLiteralNode(node)) {\n if (!isInAllowedContext(node)) {\n const startPos = node.getStart(sourceFile);\n if (startPos >= 0) {\n const pos = sourceFile.getLineAndCharacterOfPosition(startPos);\n const line = pos.line + 1;\n const column = pos.character + 1;\n const context = getViolationContext(node, sourceFile);\n const disabled = hasDisableComment(fileLines, line);\n\n inlineTypes.push({\n line,\n column,\n context,\n hasDisableComment: disabled,\n });\n }\n }\n }\n\n // Check for tuple types: [A, B]\n if (ts.isTupleTypeNode(node)) {\n if (!isInAllowedContext(node)) {\n const startPos = node.getStart(sourceFile);\n if (startPos >= 0) {\n const pos = sourceFile.getLineAndCharacterOfPosition(startPos);\n const line = pos.line + 1;\n const column = pos.character + 1;\n const context = getViolationContext(node, sourceFile);\n const disabled = hasDisableComment(fileLines, line);\n\n inlineTypes.push({\n line,\n column,\n context,\n hasDisableComment: disabled,\n });\n }\n }\n }\n } catch (error) {\n // Skip nodes that cause errors during analysis\n }\n\n ts.forEachChild(node, visit);\n }\n\n visit(sourceFile);\n return inlineTypes;\n}\n\n/**\n * Find violations in new methods only (NEW_METHODS mode).\n */\n// webpieces-disable max-lines-new-methods -- File iteration with diff parsing and method matching\nfunction findViolationsForNewMethods(\n workspaceRoot: string,\n changedFiles: string[],\n base: string,\n head?: string\n): InlineTypeViolation[] {\n const violations: InlineTypeViolation[] = [];\n\n for (const file of changedFiles) {\n const diff = getFileDiff(workspaceRoot, file, base, head);\n const newMethodNames = findNewMethodSignaturesInDiff(diff);\n\n if (newMethodNames.size === 0) continue;\n\n const methods = findMethodsInFile(file, workspaceRoot);\n const inlineTypes = findInlineTypesInFile(file, workspaceRoot);\n\n for (const inlineType of inlineTypes) {\n if (inlineType.hasDisableComment) continue;\n if (!isLineInNewMethod(inlineType.line, methods, newMethodNames)) continue;\n\n violations.push({\n file,\n line: inlineType.line,\n column: inlineType.column,\n context: inlineType.context,\n });\n }\n }\n\n return violations;\n}\n\n/**\n * Find violations in new and modified methods (MODIFIED_AND_NEW_METHODS mode).\n */\n// webpieces-disable max-lines-new-methods -- Combines new method detection with change detection\nfunction findViolationsForModifiedAndNewMethods(\n workspaceRoot: string,\n changedFiles: string[],\n base: string,\n head?: string\n): InlineTypeViolation[] {\n const violations: InlineTypeViolation[] = [];\n\n for (const file of changedFiles) {\n const diff = getFileDiff(workspaceRoot, file, base, head);\n const newMethodNames = findNewMethodSignaturesInDiff(diff);\n const changedLines = getChangedLineNumbers(diff);\n\n const methods = findMethodsInFile(file, workspaceRoot);\n const inlineTypes = findInlineTypesInFile(file, workspaceRoot);\n\n for (const inlineType of inlineTypes) {\n if (inlineType.hasDisableComment) continue;\n if (!isLineInChangedMethod(inlineType.line, methods, changedLines, newMethodNames)) continue;\n\n violations.push({\n file,\n line: inlineType.line,\n column: inlineType.column,\n context: inlineType.context,\n });\n }\n }\n\n return violations;\n}\n\n/**\n * Find all violations in modified files (MODIFIED_FILES mode).\n */\nfunction findViolationsForModifiedFiles(workspaceRoot: string, changedFiles: string[]): InlineTypeViolation[] {\n const violations: InlineTypeViolation[] = [];\n\n for (const file of changedFiles) {\n const inlineTypes = findInlineTypesInFile(file, workspaceRoot);\n\n for (const inlineType of inlineTypes) {\n if (inlineType.hasDisableComment) continue;\n\n violations.push({\n file,\n line: inlineType.line,\n column: inlineType.column,\n context: inlineType.context,\n });\n }\n }\n\n return violations;\n}\n\n/**\n * Auto-detect the base branch by finding the merge-base with origin/main.\n */\nfunction detectBase(workspaceRoot: string): string | null {\n try {\n const mergeBase = execSync('git merge-base HEAD origin/main', {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n }).trim();\n\n if (mergeBase) {\n return mergeBase;\n }\n } catch {\n try {\n const mergeBase = execSync('git merge-base HEAD main', {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n }).trim();\n\n if (mergeBase) {\n return mergeBase;\n }\n } catch {\n // Ignore\n }\n }\n return null;\n}\n\n/**\n * Report violations to console.\n */\nfunction reportViolations(violations: InlineTypeViolation[], mode: NoInlineTypesMode): void {\n console.error('');\n console.error('ā Inline type literals found! Use named types instead.');\n console.error('');\n console.error('š Named types improve code clarity and reusability:');\n console.error('');\n console.error(' BAD: function foo(arg: { x: number }) { }');\n console.error(' GOOD: type MyConfig = { x: number };');\n console.error(' function foo(arg: MyConfig) { }');\n console.error('');\n console.error(' BAD: type Nullable = { x: number } | null;');\n console.error(' GOOD: type MyData = { x: number };');\n console.error(' type Nullable = MyData | null;');\n console.error('');\n\n for (const v of violations) {\n console.error(` ā ${v.file}:${v.line}:${v.column}`);\n console.error(` ${v.context}`);\n }\n console.error('');\n\n console.error(' To fix: Extract inline types to named type aliases or interfaces');\n console.error('');\n console.error(' Escape hatch (use sparingly):');\n console.error(' // webpieces-disable no-inline-types -- [your reason]');\n console.error('');\n console.error(` Current mode: ${mode}`);\n console.error('');\n}\n\nexport default async function runExecutor(\n options: ValidateNoInlineTypesOptions,\n context: ExecutorContext\n): Promise<ExecutorResult> {\n const workspaceRoot = context.root;\n const mode: NoInlineTypesMode = options.mode ?? 'OFF';\n\n if (mode === 'OFF') {\n console.log('\\nāļø Skipping no-inline-types validation (mode: OFF)');\n console.log('');\n return { success: true };\n }\n\n console.log('\\nš Validating No Inline Types\\n');\n console.log(` Mode: ${mode}`);\n\n let base = process.env['NX_BASE'];\n const head = process.env['NX_HEAD'];\n\n if (!base) {\n base = detectBase(workspaceRoot) ?? undefined;\n\n if (!base) {\n console.log('\\nāļø Skipping no-inline-types validation (could not detect base branch)');\n console.log('');\n return { success: true };\n }\n }\n\n console.log(` Base: ${base}`);\n console.log(` Head: ${head ?? 'working tree (includes uncommitted changes)'}`);\n console.log('');\n\n const changedFiles = getChangedTypeScriptFiles(workspaceRoot, base, head);\n\n if (changedFiles.length === 0) {\n console.log('ā
No TypeScript files changed');\n return { success: true };\n }\n\n console.log(`š Checking ${changedFiles.length} changed file(s)...`);\n\n let violations: InlineTypeViolation[] = [];\n\n if (mode === 'NEW_METHODS') {\n violations = findViolationsForNewMethods(workspaceRoot, changedFiles, base, head);\n } else if (mode === 'MODIFIED_AND_NEW_METHODS') {\n violations = findViolationsForModifiedAndNewMethods(workspaceRoot, changedFiles, base, head);\n } else if (mode === 'MODIFIED_FILES') {\n violations = findViolationsForModifiedFiles(workspaceRoot, changedFiles);\n }\n\n if (violations.length === 0) {\n console.log('ā
No inline type literals found');\n return { success: true };\n }\n\n reportViolations(violations, mode);\n\n return { success: false };\n}\n"]}
|
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
* - NEW_METHODS: Only validate in new methods (detected via git diff)
|
|
66
66
|
* - MODIFIED_AND_NEW_METHODS: Validate in new methods + methods with changes
|
|
67
67
|
* - MODIFIED_FILES: Validate all violations in modified files
|
|
68
|
-
* - ALL: Validate all violations in all TypeScript files
|
|
69
68
|
*
|
|
70
69
|
* ============================================================================
|
|
71
70
|
* ESCAPE HATCH
|
|
@@ -86,7 +85,7 @@ import * as fs from 'fs';
|
|
|
86
85
|
import * as path from 'path';
|
|
87
86
|
import * as ts from 'typescript';
|
|
88
87
|
|
|
89
|
-
export type NoInlineTypesMode = 'OFF' | 'NEW_METHODS' | 'MODIFIED_AND_NEW_METHODS' | 'MODIFIED_FILES'
|
|
88
|
+
export type NoInlineTypesMode = 'OFF' | 'NEW_METHODS' | 'MODIFIED_AND_NEW_METHODS' | 'MODIFIED_FILES';
|
|
90
89
|
|
|
91
90
|
export interface ValidateNoInlineTypesOptions {
|
|
92
91
|
mode?: NoInlineTypesMode;
|
|
@@ -142,24 +141,6 @@ function getChangedTypeScriptFiles(workspaceRoot: string, base: string, head?: s
|
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
|
|
145
|
-
/**
|
|
146
|
-
* Get all TypeScript files in the workspace using git ls-files (excluding tests).
|
|
147
|
-
*/
|
|
148
|
-
function getAllTypeScriptFiles(workspaceRoot: string): string[] {
|
|
149
|
-
try {
|
|
150
|
-
const output = execSync(`git ls-files '*.ts' '*.tsx'`, {
|
|
151
|
-
cwd: workspaceRoot,
|
|
152
|
-
encoding: 'utf-8',
|
|
153
|
-
});
|
|
154
|
-
return output
|
|
155
|
-
.trim()
|
|
156
|
-
.split('\n')
|
|
157
|
-
.filter((f) => f && !f.includes('.spec.ts') && !f.includes('.test.ts'));
|
|
158
|
-
} catch {
|
|
159
|
-
return [];
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
144
|
/**
|
|
164
145
|
* Get the diff content for a specific file.
|
|
165
146
|
*/
|
|
@@ -643,14 +624,6 @@ function findViolationsForModifiedFiles(workspaceRoot: string, changedFiles: str
|
|
|
643
624
|
return violations;
|
|
644
625
|
}
|
|
645
626
|
|
|
646
|
-
/**
|
|
647
|
-
* Find all violations in all files (ALL mode).
|
|
648
|
-
*/
|
|
649
|
-
function findViolationsForAll(workspaceRoot: string): InlineTypeViolation[] {
|
|
650
|
-
const allFiles = getAllTypeScriptFiles(workspaceRoot);
|
|
651
|
-
return findViolationsForModifiedFiles(workspaceRoot, allFiles);
|
|
652
|
-
}
|
|
653
|
-
|
|
654
627
|
/**
|
|
655
628
|
* Auto-detect the base branch by finding the merge-base with origin/main.
|
|
656
629
|
*/
|
|
@@ -732,46 +705,40 @@ export default async function runExecutor(
|
|
|
732
705
|
console.log('\nš Validating No Inline Types\n');
|
|
733
706
|
console.log(` Mode: ${mode}`);
|
|
734
707
|
|
|
735
|
-
let
|
|
708
|
+
let base = process.env['NX_BASE'];
|
|
709
|
+
const head = process.env['NX_HEAD'];
|
|
736
710
|
|
|
737
|
-
if (
|
|
738
|
-
|
|
739
|
-
console.log('');
|
|
740
|
-
violations = findViolationsForAll(workspaceRoot);
|
|
741
|
-
} else {
|
|
742
|
-
let base = process.env['NX_BASE'];
|
|
743
|
-
const head = process.env['NX_HEAD'];
|
|
711
|
+
if (!base) {
|
|
712
|
+
base = detectBase(workspaceRoot) ?? undefined;
|
|
744
713
|
|
|
745
714
|
if (!base) {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
console.log('\nāļø Skipping no-inline-types validation (could not detect base branch)');
|
|
750
|
-
console.log('');
|
|
751
|
-
return { success: true };
|
|
752
|
-
}
|
|
715
|
+
console.log('\nāļø Skipping no-inline-types validation (could not detect base branch)');
|
|
716
|
+
console.log('');
|
|
717
|
+
return { success: true };
|
|
753
718
|
}
|
|
719
|
+
}
|
|
754
720
|
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
721
|
+
console.log(` Base: ${base}`);
|
|
722
|
+
console.log(` Head: ${head ?? 'working tree (includes uncommitted changes)'}`);
|
|
723
|
+
console.log('');
|
|
758
724
|
|
|
759
|
-
|
|
725
|
+
const changedFiles = getChangedTypeScriptFiles(workspaceRoot, base, head);
|
|
760
726
|
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
727
|
+
if (changedFiles.length === 0) {
|
|
728
|
+
console.log('ā
No TypeScript files changed');
|
|
729
|
+
return { success: true };
|
|
730
|
+
}
|
|
765
731
|
|
|
766
|
-
|
|
732
|
+
console.log(`š Checking ${changedFiles.length} changed file(s)...`);
|
|
767
733
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
734
|
+
let violations: InlineTypeViolation[] = [];
|
|
735
|
+
|
|
736
|
+
if (mode === 'NEW_METHODS') {
|
|
737
|
+
violations = findViolationsForNewMethods(workspaceRoot, changedFiles, base, head);
|
|
738
|
+
} else if (mode === 'MODIFIED_AND_NEW_METHODS') {
|
|
739
|
+
violations = findViolationsForModifiedAndNewMethods(workspaceRoot, changedFiles, base, head);
|
|
740
|
+
} else if (mode === 'MODIFIED_FILES') {
|
|
741
|
+
violations = findViolationsForModifiedFiles(workspaceRoot, changedFiles);
|
|
775
742
|
}
|
|
776
743
|
|
|
777
744
|
if (violations.length === 0) {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"properties": {
|
|
7
7
|
"mode": {
|
|
8
8
|
"type": "string",
|
|
9
|
-
"enum": ["OFF", "NEW_METHODS", "MODIFIED_AND_NEW_METHODS", "MODIFIED_FILES"
|
|
10
|
-
"description": "OFF: skip validation. NEW_METHODS: only new methods in diff. MODIFIED_AND_NEW_METHODS: new methods + methods with changes. MODIFIED_FILES: all inline types in modified files.
|
|
9
|
+
"enum": ["OFF", "NEW_METHODS", "MODIFIED_AND_NEW_METHODS", "MODIFIED_FILES"],
|
|
10
|
+
"description": "OFF: skip validation. NEW_METHODS: only new methods in diff. MODIFIED_AND_NEW_METHODS: new methods + methods with changes. MODIFIED_FILES: all inline types in modified files.",
|
|
11
11
|
"default": "OFF"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
@@ -13,12 +13,11 @@
|
|
|
13
13
|
* - NEW_METHODS: Only validate new methods (detected via git diff)
|
|
14
14
|
* - MODIFIED_AND_NEW_METHODS: Validate new methods + methods with changes in their line range
|
|
15
15
|
* - MODIFIED_FILES: Validate all methods in modified files
|
|
16
|
-
* - ALL: Validate all methods in all TypeScript files
|
|
17
16
|
*
|
|
18
17
|
* Escape hatch: Add webpieces-disable require-return-type comment with justification
|
|
19
18
|
*/
|
|
20
19
|
import type { ExecutorContext } from '@nx/devkit';
|
|
21
|
-
export type ReturnTypeMode = 'OFF' | 'NEW_METHODS' | 'MODIFIED_AND_NEW_METHODS' | 'MODIFIED_FILES'
|
|
20
|
+
export type ReturnTypeMode = 'OFF' | 'NEW_METHODS' | 'MODIFIED_AND_NEW_METHODS' | 'MODIFIED_FILES';
|
|
22
21
|
export interface ValidateReturnTypesOptions {
|
|
23
22
|
mode?: ReturnTypeMode;
|
|
24
23
|
}
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* - NEW_METHODS: Only validate new methods (detected via git diff)
|
|
15
15
|
* - MODIFIED_AND_NEW_METHODS: Validate new methods + methods with changes in their line range
|
|
16
16
|
* - MODIFIED_FILES: Validate all methods in modified files
|
|
17
|
-
* - ALL: Validate all methods in all TypeScript files
|
|
18
17
|
*
|
|
19
18
|
* Escape hatch: Add webpieces-disable require-return-type comment with justification
|
|
20
19
|
*/
|
|
@@ -63,24 +62,6 @@ function getChangedTypeScriptFiles(workspaceRoot, base, head) {
|
|
|
63
62
|
return [];
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
|
-
/**
|
|
67
|
-
* Get all TypeScript files in the workspace using git ls-files (excluding tests).
|
|
68
|
-
*/
|
|
69
|
-
function getAllTypeScriptFiles(workspaceRoot) {
|
|
70
|
-
try {
|
|
71
|
-
const output = (0, child_process_1.execSync)(`git ls-files '*.ts' '*.tsx'`, {
|
|
72
|
-
cwd: workspaceRoot,
|
|
73
|
-
encoding: 'utf-8',
|
|
74
|
-
});
|
|
75
|
-
return output
|
|
76
|
-
.trim()
|
|
77
|
-
.split('\n')
|
|
78
|
-
.filter((f) => f && !f.includes('.spec.ts') && !f.includes('.test.ts'));
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
65
|
/**
|
|
85
66
|
* Get the diff content for a specific file.
|
|
86
67
|
*/
|
|
@@ -334,13 +315,6 @@ function findViolationsForModifiedFiles(workspaceRoot, changedFiles) {
|
|
|
334
315
|
}
|
|
335
316
|
return violations;
|
|
336
317
|
}
|
|
337
|
-
/**
|
|
338
|
-
* Find all methods without explicit return types in all files (ALL mode).
|
|
339
|
-
*/
|
|
340
|
-
function findViolationsForAll(workspaceRoot) {
|
|
341
|
-
const allFiles = getAllTypeScriptFiles(workspaceRoot);
|
|
342
|
-
return findViolationsForModifiedFiles(workspaceRoot, allFiles);
|
|
343
|
-
}
|
|
344
318
|
/**
|
|
345
319
|
* Auto-detect the base branch by finding the merge-base with origin/main.
|
|
346
320
|
*/
|
|
@@ -408,41 +382,34 @@ async function runExecutor(options, context) {
|
|
|
408
382
|
}
|
|
409
383
|
console.log('\nš Validating Return Types\n');
|
|
410
384
|
console.log(` Mode: ${mode}`);
|
|
411
|
-
let
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
violations = findViolationsForAll(workspaceRoot);
|
|
416
|
-
}
|
|
417
|
-
else {
|
|
418
|
-
let base = process.env['NX_BASE'];
|
|
419
|
-
const head = process.env['NX_HEAD'];
|
|
385
|
+
let base = process.env['NX_BASE'];
|
|
386
|
+
const head = process.env['NX_HEAD'];
|
|
387
|
+
if (!base) {
|
|
388
|
+
base = detectBase(workspaceRoot) ?? undefined;
|
|
420
389
|
if (!base) {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
console.log('\nāļø Skipping return type validation (could not detect base branch)');
|
|
424
|
-
console.log('');
|
|
425
|
-
return { success: true };
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
console.log(` Base: ${base}`);
|
|
429
|
-
console.log(` Head: ${head ?? 'working tree (includes uncommitted changes)'}`);
|
|
430
|
-
console.log('');
|
|
431
|
-
const changedFiles = getChangedTypeScriptFiles(workspaceRoot, base, head);
|
|
432
|
-
if (changedFiles.length === 0) {
|
|
433
|
-
console.log('ā
No TypeScript files changed');
|
|
390
|
+
console.log('\nāļø Skipping return type validation (could not detect base branch)');
|
|
391
|
+
console.log('');
|
|
434
392
|
return { success: true };
|
|
435
393
|
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
394
|
+
}
|
|
395
|
+
console.log(` Base: ${base}`);
|
|
396
|
+
console.log(` Head: ${head ?? 'working tree (includes uncommitted changes)'}`);
|
|
397
|
+
console.log('');
|
|
398
|
+
const changedFiles = getChangedTypeScriptFiles(workspaceRoot, base, head);
|
|
399
|
+
if (changedFiles.length === 0) {
|
|
400
|
+
console.log('ā
No TypeScript files changed');
|
|
401
|
+
return { success: true };
|
|
402
|
+
}
|
|
403
|
+
console.log(`š Checking ${changedFiles.length} changed file(s)...`);
|
|
404
|
+
let violations = [];
|
|
405
|
+
if (mode === 'NEW_METHODS') {
|
|
406
|
+
violations = findViolationsForNewMethods(workspaceRoot, changedFiles, base, head);
|
|
407
|
+
}
|
|
408
|
+
else if (mode === 'MODIFIED_AND_NEW_METHODS') {
|
|
409
|
+
violations = findViolationsForModifiedAndNewMethods(workspaceRoot, changedFiles, base, head);
|
|
410
|
+
}
|
|
411
|
+
else if (mode === 'MODIFIED_FILES') {
|
|
412
|
+
violations = findViolationsForModifiedFiles(workspaceRoot, changedFiles);
|
|
446
413
|
}
|
|
447
414
|
if (violations.length === 0) {
|
|
448
415
|
console.log('ā
All methods have explicit return types');
|