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

YAML Formatting VSCode Settings #207

Open
callumforrester opened this issue Oct 25, 2024 · 4 comments
Open

YAML Formatting VSCode Settings #207

callumforrester opened this issue Oct 25, 2024 · 4 comments

Comments

@callumforrester
Copy link
Contributor

Different people may have different default YAML formatters configured in their user settings. These may even fight each other in multi-author PRs and similar. We should decide on one and put it in the repo settings.

Acceptance Critera

  • .vscode/settings.json includes a default YAML formatter
  • Recommended extension settings includes the extension used if applicable
@coretl
Copy link
Contributor

coretl commented Oct 25, 2024

We have

"editor.formatOnSave": true,
and which on my vscode seems to format to 2 space indent.

It's a shame there isn't an associated pre-commit hook for the vscode yaml plugin...

@callumforrester
Copy link
Contributor Author

Hmm, can we move the devcontainer line to the vscode settings so it works outside a devcontainer as well?

@coretl
Copy link
Contributor

coretl commented Oct 29, 2024

This line?


At the moment the only "outside the devcontainer" recommendation is:
"ms-vscode-remote.remote-containers",

We could duplicate the devcontainer.json section into extensions.json and then you would be prompted to install some extensions outside the devcontainer as well as inside. Do we want that?

@callumforrester
Copy link
Contributor Author

callumforrester commented Oct 30, 2024

From offline discussion: The impetus for this issue was two developers with two different YAML formatting plugins that disagreed with each other. As the two worked on the same PR together the YAML would change back and forth with each push. It probably does make sense, given that we have that following in setting.json:

"[python]": {
    "editor.defaultFormatter": "charliermarsh.ruff",
},

which basically says "whatever you have installed, use ruff", to do the same for the RedHat YAML plugin.

However, there needs to be a discussion about just how opinionated we are willing to get about using devcontainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants