Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L003 (indentation rule): Improve anchors for fixes to avoid corrupting parse tree #2664

Conversation

barrywhart
Copy link
Member

@barrywhart barrywhart commented Feb 15, 2022

Brief summary of the change made

Makes progress on #1304

This PR attempts to specifically address the issue with L003 placing whitespace at illegal places in the parse tree. The other PR (#2657) for this issue is more ambitious, attempting to automatically detect all such issues across all rules. I'll continue working on that one, but it's possible I won't ever get it working.

Are there any other side effects of this change that we should be aware of?

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.

@codecov
Copy link

codecov bot commented Feb 15, 2022

Codecov Report

Merging #2664 (dc00617) into main (8ff1aa7) will not change coverage.
The diff coverage is 100.00%.

❗ Current head dc00617 differs from pull request most recent head 1c17a5a. Consider uploading reports for the commit 1c17a5a to get more accurate results

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #2664   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          163       163           
  Lines        12014     12023    +9     
=========================================
+ Hits         12014     12023    +9     
Impacted Files Coverage Δ
src/sqlfluff/rules/L003.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ff1aa7...1c17a5a. Read the comment docs.

@barrywhart barrywhart marked this pull request as draft February 16, 2022 10:55
@barrywhart barrywhart closed this Feb 16, 2022
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.

None yet

1 participant