-
Notifications
You must be signed in to change notification settings - Fork 0
Factory DAO Method Check #272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Implements return type and parameter validation for Factory DAO methods, mirroring existing checks for other annotated methods.
- Added Factory return type and parameter check processors
- Updated visitors to include Factory annotations in inspection
- Extended tests and updated message bundle keys and processor naming
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/testData/src/main/java/doma/example/dao/inspection/returntype/FactoryReturnTypeTestDao.java | Add test cases for Factory return type validation |
| src/test/testData/src/main/java/doma/example/dao/inspection/paramtype/InsertUpdateDeleteParamTestDao.java | Update error description wording |
| src/test/testData/src/main/java/doma/example/dao/inspection/paramtype/FactoryParamTestDao.java | Add test cases for Factory parameter validation |
| src/test/kotlin/org/domaframework/doma/intellij/inspection/dao/AnnotationReturnTypeCheckInspectionTest.kt | Register FactoryReturnTypeTestDao in return type tests |
| src/test/kotlin/org/domaframework/doma/intellij/inspection/dao/AnnotationParamTypeCheckInspectionTest.kt | Register FactoryParamTestDao in parameter type tests |
| src/main/resources/messages/DomaToolsBundle_ja.properties | Rename Japanese parameter validation key (inconsistent) |
| src/main/resources/messages/DomaToolsBundle.properties | Rename English parameter validation key |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/visitor/DaoMethodReturnTypeInspectionVisitor.kt | Include Factory annotations in return type visitor |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/visitor/DaoMethodParamTypeInspectionVisitor.kt | Include Factory annotations in parameter type visitor |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/returntype/UpdateReturnTypeCheckProcessor.kt | Rename processor class to UpdateReturnTypeCheckProcessor |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/returntype/SqlProcessorReturnTypeCheckProcessor.kt | Rename processor class to SqlProcessorReturnTypeCheckProcessor |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/returntype/SelectReturnTypeCheckProcessor.kt | Rename processor class to SelectReturnTypeCheckProcessor |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/returntype/ScriptReturnTypeCheckProcessor.kt | Rename processor class to ScriptReturnTypeCheckProcessor |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/returntype/ProcedureReturnTypeCheckProcessor.kt | Rename processor class to ProcedureReturnTypeCheckProcessor |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/returntype/MultiInsertReturnTypeCheckProcessor.kt | Rename processor class to MultiInsertReturnTypeCheckProcessor |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/returntype/FunctionReturnTypeCheckProcessor.kt | Rename processor class to FunctionReturnTypeCheckProcessor |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/returntype/FactoryReturnTypeCheckProcessor.kt | New processor for Factory return type validation |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/returntype/BatchReturnTypeCheckProcessor.kt | Rename processor class to BatchReturnTypeCheckProcessor |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/paramtype/UpdateParamTypeCheckProcessor.kt | Switch to ValidationMethodParamTypeResult for entity parameter errors |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/paramtype/FactoryParamTypeCheckProcessor.kt | New processor for Factory parameter validation |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/FactoryAnnotationType.kt | Define metadata for Factory annotations |
| src/main/kotlin/org/domaframework/doma/intellij/extension/psi/DomaAnnotationType.kt | Add Factory annotation types to the DomaAnnotationType enum |
| src/main/kotlin/org/domaframework/doma/intellij/common/validation/result/ValidationMethodParamTypeResult.kt | Rename entity param result class and update its message key |
Comments suppressed due to low confidence (4)
src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/returntype/FactoryReturnTypeCheckProcessor.kt:24
- [nitpick] Update the KDoc comment to reference Factory annotations instead of SqlProcessor, e.g., "Processor for checking the return type of Factory annotations."
* Processor for checking the return type of SqlProcessor annotation.
src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/visitor/DaoMethodParamTypeInspectionVisitor.kt:51
- Missing import for SelectParamTypeCheckProcessor; add
import org.domaframework.doma.intellij.inspection.dao.processor.paramtype.SelectParamTypeCheckProcessorto avoid compile errors.
DomaAnnotationType.Select -> {
src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/visitor/DaoMethodParamTypeInspectionVisitor.kt:58
- Missing import for UpdateParamTypeCheckProcessor; add
import org.domaframework.doma.intellij.inspection.dao.processor.paramtype.UpdateParamTypeCheckProcessorto avoid compile errors.
DomaAnnotationType.Insert, DomaAnnotationType.Update, DomaAnnotationType.Delete -> {
src/main/resources/messages/DomaToolsBundle_ja.properties:27
- The translation key should match the English bundle (
inspection.invalid.dao.params.type); rename this key toinspection.invalid.dao.params.typefor consistency.
inspection.invalid.dao.params=\u5F15\u6570\u306E\u578B\u306F{0}\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093
Implement code inspection functionality to perform return type checks and parameter checks on Factory DAO methods, similar to the existing checks for other annotated methods.