Skip to content

Configurable SQL formatter rules #2529

Description

@datlechin

Problem

The formatter has one style. Keyword case is settable and the rest is not, so a team whose house style differs on indent width, comma placement, or where a join breaks has to reformat by hand after every use, or stop using it.

Proposed solution

  • A Formatter section in Settings > Editor: indent width and character, keyword and function case, leading or trailing commas, line width, whether to break before or after a join, and whether to align aliases.
  • A live preview beside the options, using the current editor theme.
  • Export and import the rule set, so a team can share one.
  • Read a .sql-formatter.json from the project folder when one is present, the way project folder import already reads project config.

Alternatives considered

Format elsewhere and paste the result back.

Related database type

N/A / General

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions