Skip to content

Conversation

@xterao
Copy link
Collaborator

@xterao xterao commented May 27, 2025

List-type test data containing uppercase TRUE, FALSE, or NULL values are not currently recognized as valid. This change adds a case-insensitive flag to the regular expression so that true, TRUE, False, FALSE, null, NULL, etc., are all correctly detected.

@xterao xterao self-assigned this May 27, 2025
@xterao xterao added bug Something isn't working fix Bug fixes labels May 27, 2025
@xterao xterao added this to the 0.8.0 Release milestone May 27, 2025
@xterao xterao linked an issue May 27, 2025 that may be closed by this pull request
@xterao xterao requested a review from Copilot May 27, 2025 06:37
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 enhances SQL test data validation by enabling case-insensitive support for boolean and null values in list-type test data.

  • Updated test data in the SQL file to include mixed-case boolean and null values.
  • Modified the regex in the Kotlin file to include the case-insensitive flag (RegexOption.IGNORE_CASE) for detecting these values.

Reviewed Changes

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

File Description
src/test/testData/src/main/resources/META-INF/doma/example/dao/inspection/TestDataCheckDao/commentBlock.sql Test data updated with mixed-case boolean and null values
src/main/kotlin/org/domaframework/doma/intellij/inspection/sql/visitor/SqlTestDataAfterBlockCommentVisitor.kt Updated regex to support case-insensitive matching
Comments suppressed due to low confidence (1)

src/main/kotlin/org/domaframework/doma/intellij/inspection/sql/visitor/SqlTestDataAfterBlockCommentVisitor.kt:107

  • [nitpick] The regex pattern is quite complex; adding inline comments or breaking it into smaller, named subpatterns would improve readability and maintainability.
Regex( """^(\(\s*(?:(?:"[^"]*"|'[^']*'|\d+|true|false|null)\s*(?:,\s*(?:"[^"]*"|'[^']*'|\d+|true|false|null)\s*)*)?\)$""",

@xterao xterao merged commit 7bae2f2 into main May 27, 2025
3 checks passed
@xterao xterao deleted the fix/test-data-validation branch May 27, 2025 06:54
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.

Fix Test-Data Validation

2 participants