Skip to content

Conversation

@xterao
Copy link
Collaborator

@xterao xterao commented May 28, 2025

Fixed error message texts.

  • In custom function checks, if doma.expr.functions is not set, show org.seasar.doma.expr.ExpressionFunctions as the reference class.
  • In test data checks, specify the target directive in the message.

Also updated the SQL format settings description in the README.

@xterao xterao self-assigned this May 28, 2025
@xterao xterao added bug Something isn't working fix Bug fixes labels May 28, 2025
@xterao xterao linked an issue May 28, 2025 that may be closed by this pull request
@xterao xterao requested a review from Copilot May 28, 2025 01:48
@xterao xterao added this to the 1.0.0 Release milestone May 28, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates error message texts for SQL inspections, centralizes the default expression functions class name, adds a test case for empty custom functions, and clarifies auto‐indent settings in the README.

  • Refined inspection error messages to mention bind or literal variable directives and updated custom‐function not‐found wording.
  • Introduced EXPRESSION_FUNCTIONS_NAME constant and applied it in processor/helper.
  • Added emptyImplementCustomFunctions.sql test and corresponding testEmptyImplementCustomFunctions method.
  • Revised README to describe SQL formatter auto‐indent settings.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.../populateDirective.sql Updated test‐data error message text
.../literalDirective.sql Updated test‐data error message text
.../invalidTestData.sql Updated test‐data error message text
.../conditionAndLoopDirective.sql Updated test‐data error message text
.../commentBlock.sql Updated test‐data error message text
.../bindVariableDirective.sql Updated test‐data error message text
.../implementCustomFunctions.sql Reworded custom‐function error descriptions
.../emptyImplementCustomFunctions.sql New test data fixture for empty custom functions
ParameterDefinedTest.kt Included new SQL in test suite and added test method
DomaToolsBundle*.properties Localized and default messages updated to match new text
InspectionFunctionCallVisitorProcessor.kt Defaulted missing custom‐function class to constant
ExpressionFunctionsHelper.kt Switched hardcoded class name to constant
DomaCompileConfigUtil.kt Introduced EXPRESSION_FUNCTIONS_NAME constant
README.md Clarified SQL auto‐indent feature and its settings path
Comments suppressed due to low confidence (2)

src/test/testData/src/main/resources/META-INF/doma/example/dao/EmployeeSummaryDao/emptyImplementCustomFunctions.sql:2

  • The alias 'e' is undefined (the FROM clause uses alias 'u'). Consider using 'u.employee_id' or renaming the table alias to 'e'.
    e.employee_id

src/test/testData/src/main/resources/META-INF/doma/example/dao/EmployeeSummaryDao/emptyImplementCustomFunctions.sql:6

  • The alias 'p' is undefined in this SQL. Update it to match the declared table alias ('u') or correct the aliasing.
 WHERE p.employee_id = /* employee.employeeId */0

@xterao xterao force-pushed the fix/update-error-message branch from f988183 to 7ee2a6c Compare May 28, 2025 01:59
@xterao xterao merged commit 7795a6c into main May 28, 2025
3 checks passed
@xterao xterao deleted the fix/update-error-message branch May 28, 2025 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update error message for custom-function validation

2 participants