Implement AnalyzerConfiguration and AnalyzerError (#110)#170
Conversation
Add AnalyzerConfiguration as a plain Sendable struct with an explicit public memberwise init (the skit analyze subcommand constructs it from another module), and AnalyzerError covering all analyzer pipeline failure cases. One type per file, no configuration-framework dependency. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review: Implement AnalyzerConfiguration and AnalyzerError (#110)OverviewAdds two plain data types — Issues
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## claude-prompt #170 +/- ##
=================================================
- Coverage 80.16% 80.11% -0.06%
=================================================
Files 153 153
Lines 5209 5209
=================================================
- Hits 4176 4173 -3
- Misses 1033 1036 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code Review — PR 170: Implement AnalyzerConfiguration and AnalyzerError Clean, minimal implementations. Two issues worth fixing before merge. Issue 1 —
Recommendation: Add extension AnalyzerError: LocalizedError {
public var errorDescription: String? {
switch self {
case .missingRequiredArguments(let msg),
.missingAPIKey(let msg),
.invalidPath(let msg),
.missingInputFile(let msg),
.astGenerationError(let msg),
.apiError(let msg),
.codeGenerationError(let msg):
return msg
}
}
}Issue 2 —
Recommendation: Implement extension AnalyzerConfiguration: CustomDebugStringConvertible {
public var debugDescription: String {
"AnalyzerConfiguration(inputFolderPath: \(inputFolderPath), " +
"syntaxKitPath: \(syntaxKitPath), outputFolderPath: \(outputFolderPath), " +
"apiKey: [REDACTED], model: \(model), verbose: \(verbose))"
}
}Minor observations
|
Closes #110
Summary
AnalyzerConfiguration(Sources/AiSTKit/AnalyzerConfiguration.swift): a plainpublic struct … : SendablewithinputFolderPath,syntaxKitPath,outputFolderPath,apiKey,model, andverbose. Includes an explicitpublic initsince the auto-generated memberwise init would beinternaland theskit analyzesubcommand (Implement skit analyze Subcommand (ArgumentParser) #111) constructs it from another module.AnalyzerError(Sources/AiSTKit/AnalyzerError.swift):public enum … : Errorwith all seven cases from the plan doc (missingRequiredArguments,missingAPIKey,invalidPath,missingInputFile,astGenerationError,apiError,codeGenerationError), each carrying a message string.No configuration-framework dependency; one type per file per skit-analyze-plan.md.
Verification
swift buildpassesswift-format lintandswiftlint --strictwith zero violations./Scripts/lint.shreports only a pre-existing local Periphery failure ("index store path does not exist"), which reproduces on the clean tree and is skipped on CI🤖 Generated with Claude Code