The .CursorRules file contains the rules that need to be followed for our SQL code reviews.
In Cursor’s SQL code review output, the constraint naming pattern is being displayed without an underscore, despite the pattern being correctly defined in the .CursorRules file.
Current Behavior:
Screen Output in Cursor:
File: CREATEdboRoutingProposal_VNG-16085.sql
Constraints Rule 1a: Naming Convention
Issue: Constraint name doesn’t follow the pattern {constraint_type}{schema_name}{table_name}{field_name}
Example of correct code:
Apply to .cursorrules
Expected Behavior:
Screen Output should be:
File: CREATEdboRoutingProposal_VNG-16085.sql
Constraints Rule 1a: Naming Convention
Issue: Constraint name doesn’t follow the pattern {constraint_type}{schema_name}{table_name}_{field_name}
Example of correct code:
Apply to .cursorrules
Configuration:
The .CursorRules file correctly defines the pattern with underscore in multiple places:
constraints:
- rule_designation: "Constraints Rule 1a"
title: "Naming Convention"
naming_convention: "{constraint_type}{schema_name}{table_name}_{field_name}"
pattern_display: "{constraint_type}{schema_name}{table_name}_{field_name}"
violation_message: "Constraint name doesn't follow the pattern {constraint_type}{schema_name}{table_name}_{field_name}"
output_template: "Issue: Constraint name doesn't follow the pattern {constraint_type}{schema_name}{table_name}_{field_name}"
Attempted Solutions:
- Added
pattern_display
field with underscore - Added
violation_message
field with underscore - Added
output_template
field with underscore
None of these attempts affected the output message format in Cursor.
Steps to Reproduce:
- Create a SQL file with a constraint that violates the naming convention
- Run the code review using the .CursorRules file in Cursor
- Observe that the output message is missing the underscore in the pattern
Example SQL that triggers the issue:
CONSTRAINT [FKDboRoutingProposal_BookingConsolidationProposalId] FOREIGN KEY([BookingConsolidationProposalId])
REFERENCES [VMS].[dbo].[BookingConsolidationProposal] (BookingConsolidationProposalId)
Impact:
The missing underscore in Cursor’s output message could lead to confusion about the correct naming pattern, even though the rule itself is working correctly in identifying and correcting violations.
Environment:
- Cursor IDE Version: 0.47.5 (53d6da1322f934a1058e7569ee0847b24879d180 x64)
- OS: Windows 10.0.19045
- SQL Server: 2019
- AI Agent: Claude 3.5 Sonnet