Skip to content

Conversation

LuigiCerone
Copy link
Contributor

@LuigiCerone LuigiCerone commented Nov 14, 2024

Brief summary of the change made

According to the official documentation, rules can be downgraded to warnings by specifying their rule codes. However, there is IHMO an inconsistency in how rules are handled for exclusions versus warnings. Currently:

  • Rules can be excluded using either rule code or rule name.
  • Rules can only be downgraded to warnings using rule code.

This PR addresses this inconsistency by extending the configuration to allow warnings to be specified via both rule code and rule name. This aligns the handling of warnings with the existing behavior for exclude_rules.

Pull Request checklist

  • Please confirm you have completed any of the necessary steps below.

  • Included test cases to demonstrate any code changes, which may be one or more of the following:

    • .yml rule test cases in test/fixtures/rules/std_rule_cases.
    • .sql/.yml parser test cases in test/fixtures/dialects (note YML files can be auto generated with tox -e generate-fixture-yml).
    • Full autofix test cases in test/fixtures/linter/autofix.
    • Other.
  • Added appropriate documentation for the change.

  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

@LuigiCerone LuigiCerone force-pushed the feat/add_rule_name_warnings branch from a4f02bd to 7f63e46 Compare November 14, 2024 20:30
Copy link
Contributor

@WittierDinosaur WittierDinosaur left a comment

Choose a reason for hiding this comment

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

LGTM

@WittierDinosaur
Copy link
Contributor

Small linting error

Copy link
Contributor

github-actions bot commented Nov 16, 2024

Coverage Results ✅

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

243 files skipped due to complete coverage.

auto-merge was automatically disabled November 18, 2024 19:27

Head branch was pushed to by a user without write access

@LuigiCerone LuigiCerone force-pushed the feat/add_rule_name_warnings branch from 7f63e46 to 6d33d13 Compare November 18, 2024 19:27
@LuigiCerone LuigiCerone force-pushed the feat/add_rule_name_warnings branch from 6d33d13 to 8f0890f Compare November 19, 2024 16:29
@alanmcruickshank alanmcruickshank added this pull request to the merge queue Nov 21, 2024
Merged via the queue into sqlfluff:main with commit 787b58e Nov 21, 2024
29 checks passed
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.

3 participants