-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Offer an option for YAML indent option #9355
Comments
Hi! This is Wikipedia’s definition of “dilemma”:
I can see that you have two possibilities – to format or not to format, that is the question – but you didn’t mention the pros and cons of each choice? To me it sounds like you’re into the concept of having automatic formatting, so running Prettier on all those files is the clear winner. Without more details it’s hard for us to give any advice. What exactly is the problem you have? |
Well, leaving aside if I used the word 'dilemma' properly, I will say that yes, I see two options:
My ultimate preference it the best of both worlds... to use prettier, but to have an option for YAML sequence indentation rules. |
I don’t see how the indent option is going to help you? You’ll still have cases where Prettier changes the generated yaml files because of other little formatting differences. (Note: I wasn’t trying to nitpick on the word “dilemma” – I meant that it didn’t seem like you had a dilemma given the info your provided. “Use Prettier as-is” was the clear winner.) |
I thought my examples were clear, so I'm not sure what else to add to them. |
Ok. Since the option philosophy states that the bar for new options is very high, I’ll close this then if we don’t have a super clear reason for it. |
I came across issue #4723 wherein the community decided on the indentation style for yaml mappings. It seems that the community voted to indent sequences, which is how the tool currently works. I recently started implementing prettier in my repositories, but this is causing a problem.
Microsoft's documentation examples are all based on "do not indent".
Example: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/runtime-parameters?view=azure-devops&tabs=script#use-parameters-in-pipelines
I'm now stuck with a dilemma. Do I keep prettier "as-is", which will format all of my yml files, as well as yml code blocks in my markdown files or do I utilize prettierignore to ignore the Azure Pipeline yml files, and any markdown files related to Azure Pipelines?
One of my repositories houses over 100 yml files (Azure Pipeline YAML templates), as well as markdown files which document and give examples of those pipeline files. On top of that, I have a lot of repositories that contain an
azure-pipelines.yml
andazurepipelines-coverage.yml
file.I realize that Prettier is very opionionated about code formatting, but is this a possible option that can be added?
The text was updated successfully, but these errors were encountered: