Skip to content

.editorconfig formatting option to start new lines with commas + space rather than ending lines with comma #171

@Will-at-FreedomDev

Description

@Will-at-FreedomDev

I was redirected here to create this issue from: madskristensen/SqlFormatter#24

Original request

Is your feature request related to a problem? Please describe.
My team standardizes on commas being placed at the beginning of a line rather than at the end of the line. This would be for lists specfically, not necessarily function arguments. For example: the SELECT clause primarily, but also includes IN lists, object definitions (parameter lists, column lists, etc.)) This formatter doesn't appear to support this code standard. I'd love for our team to use a formatter to follow our code standards such as this one.

Describe the solution you'd like
I would like an opt-in option for the .editorconfig to allow for this format:

SELECT 
    u.Id
    , u.Name
    , u.Email
FROM Users u

I think the formatter also places the first column on the same line as the SELECT and uses AS for aliasing, but that's a compromise my team can live with.

Describe alternatives you've considered
It seems like we would have to build our own Visual Studio extension?

Additional context
This online formatter provides this option. https://www.dpriver.com/pp/sqlformat.htm

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions