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

Fix SQL whitespace handing in comments #897

Merged
merged 1 commit into from Jul 20, 2021

Commits on Jul 20, 2021

  1. Fix SQL whitespace handing in comments

    This fixes several issues to how whitespace was formatted related to
    comments in SQL formatter:
    
     - A line after the comment would get an additional leading space, this
       was especially visible for multi-line comments. For example:
       ```
       -- comment
       CREATE TABLE ...
       ```
       Would be formatted as:
       ```
       -- comment
        CREATE TABLE ...
       ```
     - An inline comment would be indented and placed on a separate line.
       For example:
       ```
       CREATE TABLE products (
           category_id INTEGER, -- lookup in categories table
           color VARCHAR(50),
       )
       ```
       Would be formatted as:
       ```
       CREATE TABLE products (
           category_id INTEGER,
           -- lookup in categories table
       color VARCHAR(50),
       )
       ```
    
    This fixes those issues in by patching these specific cases.
    zregvart committed Jul 20, 2021
    Configuration menu
    Copy the full SHA
    39a1102 View commit details
    Browse the repository at this point in the history