Triage: Oracle capitalisation rules don't check PL/SQL package/function calls#7467
Triage: Oracle capitalisation rules don't check PL/SQL package/function calls#7467Copilot wants to merge 6 commits into
Conversation
|
@alanmcruickshank : I'd need your help to get more of the history. What was the reason to exclude multi-part function names from the capitalization rules? Should we revise that and allow such functions names to take advantage this CP03 rule? |
Coverage Results ✅ |
|
@saulotoledo - can you add here your opinion as somebody who is working with Oracle dialect more closely? |
|
Hi @peterbud, apologies for the wait. I agree this is a bug. I expect these cases to be flagged as violations. I see the source code explicitly excludes this scenario without a comment. If this was intentional, I’m failing to see the reasoning behind it. In my opinion, removing the exclusion entirely is the best path forward. This would cause a behavior change; while I don't currently have a scenario where that change would be a problem, I am unsure how it might affect others, given that it impacts more than just the Oracle dialect. If there is a specific reason for the exclusion that we need to respect, perhaps we should consider an alternative, such as making it a configurable option (the second suggestion)? |
This PR contains triage work only - no fix has been implemented yet.
Issue Confirmed
Capitalisation rules CP02/CP03 skip qualified function calls like
dbms_output.PUT_LINE()due to an assumption that all multi-part function names are case-sensitive UDFs.Root Cause
src/sqlfluff/rules/capitalisation/CP01.pylines 88-89 explicitly excludes any identifier within a multi-partfunction_namesegment:This affects Oracle (and potentially other dialects) where package.function calls should respect capitalisation policies.
Minimal Reproduction
With
extended_capitalisation_policy = lower, neither the package names nor function names trigger violations.Next Steps
Implementation options:
No code changes implemented - triage only.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.