microsoft / azure-pipelines-vscode

VS Code extension for working with Azure Pipelines YAML files
MIT License
164 stars 104 forks source link

Recommended formatter, Prettier, indents block sequences #588

Open siewers opened 4 months ago

siewers commented 4 months ago

According to the documentation on Azure Pipeline formatting, block sequences should not be indented:

parameters:
- name: param1
  type: string
- name: param2
  type: string

However, using the Prettier formatter, the sequences are indented:

parameters:
  - name: param1
    type: string
  - name: param2
    type: string

The Prettier maintainer has a clear philosophy and will not make any exceptions (see related issue), which makes sense.

However, as the issue describes, we're stuck between using a formatter that works with the Azure Pipelines extension and none (the default behaves similarly and does the same indentation). So, currently, it's impossible to use a formatter if we want to adhere to the standard described throughout the documentation.

As explained in this issue, the redhat.vscode-yaml formatter won't work if the file types are azure-pipelines as it only accepts yaml.

Do you know if there are any plans to use a different formatter, or what is your recommendation?