Skip to content

Triage: Oracle capitalisation rules don't check PL/SQL package/function calls#7467

Draft
Copilot wants to merge 6 commits into
mainfrom
copilot/add-capitalisation-rule-plsql
Draft

Triage: Oracle capitalisation rules don't check PL/SQL package/function calls#7467
Copilot wants to merge 6 commits into
mainfrom
copilot/add-capitalisation-rule-plsql

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 9, 2026

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.py lines 88-89 explicitly excludes any identifier within a multi-part function_name segment:

if parent.get_type() == "function_name" and len(parent.segments) != 1:
    return [LintResult(memory=context.memory)]

This affects Oracle (and potentially other dialects) where package.function calls should respect capitalisation policies.

Minimal Reproduction

BEGIN
   dbms_output.PUT_LINE('hello');  -- Not checked
   myPackage.myFunction('test');    -- Not checked
END;

With extended_capitalisation_policy = lower, neither the package names nor function names trigger violations.

Next Steps

Implementation options:

  • Remove the exclusion entirely
  • Add config option to enable checking for qualified functions
  • Make exclusion dialect-specific

No code changes implemented - triage only.

Original prompt

This section details on the original issue you should resolve

<issue_title>[oracle] Capitalisation rules for PL/SQL package/function/procedure calls</issue_title>
<issue_description>### Search before asking

  • I searched the issues and found no similar issues.

Description

Hi,
currently package/function/procedure names in a PL/SQL block are ignored by the current capitalisation rules.

Example:

declare
   v_message varchar2(50);
begin
   v_message := 'Hello PL/SQL!';
   dbms_output.PUT_LINE(v_message); 
end;

dbms_output.PUT_LINE(v_message); will not be marked . The same also applies to custom packages.
So stuff like myPackage.myFunction(abc); will also not be marked.

We would like to be able to activate some rule that allows us to control the capitalisation of such calls so we can have consistent casing.

Would you consider this in scope for sqlfluff?

Use case

No response

Dialect

Oracle

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

Comments on the Issue (you are @copilot in this section)

Custom agent used: Triage Agent
Reproduces reported issues and creates minimal reproduction cases for SQLFluff bug reports


💡 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.

Copilot AI changed the title [WIP] Add capitalisation rules for PL/SQL package/function/procedure calls Triage: Oracle capitalisation rules don't check PL/SQL package/function calls Feb 9, 2026
Copilot AI requested a review from peterbud February 9, 2026 07:54
@peterbud
Copy link
Copy Markdown
Contributor

@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?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 27, 2026

Coverage Results ✅

Name    Stmts   Miss  Cover   Missing
-------------------------------------
TOTAL   21559      0   100%

263 files skipped due to complete coverage.

@peterbud
Copy link
Copy Markdown
Contributor

peterbud commented Apr 3, 2026

@saulotoledo - can you add here your opinion as somebody who is working with Oracle dialect more closely?

@saulotoledo
Copy link
Copy Markdown
Contributor

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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[oracle] Capitalisation rules for PL/SQL package/function/procedure calls

3 participants