-
Notifications
You must be signed in to change notification settings - Fork 12
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
style: Adjust YAML IDE formatting and reformat .tekton/*.yaml
#1515
Conversation
Only used IDE command, no other changes.
Skipping CI for Draft Pull Request. |
…atter" This reverts commit 5072e25. Will use `.editorconfig` for this.
.tekton/*
yaml files with GoLand
.tekton/*
yaml files with GoLand.tekton/*.yaml
.tekton/*.yaml
.tekton/*.yaml
/test e2e-tests |
/test e2e-tests |
@msugakov: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This is a follow up on a thread from #1492 (comment).
When I compared how yamls are formatted in
stackrox/stackrox
andstackrox/scanner
, I noticed a difference:stackrox/stackrox
stackrox/scanner
Turns out, we have a setting for
stackrox/stackrox
since this PR from June 2021. I remember seeing and reviewing it and also remember that I went on vacation despite it was a busy time standing up RHACS Operator for the first time. I did not have a chance to ask why Malte configured the setting this way and, unfortunately, he did not leave a justification in the PR.However, YAML list items indentation applied in StackRox is consistent with how k8s resources are typically formatted, see for example https://kubernetes.io/docs/concepts/services-networking/network-policies/#networkpolicy-resource. That's the reason why, I think, it was selected.
I add this setting to
stackrox/scanner
as a style rule and apply it to the contents of.tekton/
directory. Other YAML files may be reformatted later by other colleagues. I don't want to mess them up myself :-)Choosing a way to introduce the setting, two options came up:
.editorconfig
settings. The first attempt I remember is https://github.com/stackrox/rox/pull/8859 (here's how Tomek obtained contents).JetBrains settings look custom and
.gitignore
rules are a bit scary..editorconfig
settings are not much better because the one I use -ij_yaml_indent_sequence_value
- is JetBrains "extension" and is simply absent in EditorConfig. EditorConfig is not sophisticated enough to support this level of formatting. That means, JetBrains products will respect the setting but not others.In either case, VSCode users seem to be out of luck according to comments redhat-developer/vscode-yaml#172 so I can only sigh and hope someone who cares enough can dedicate time to research and find a solution for VSCode.
Note for reviewers:
.tekton/*.yaml
files were reformatted in GoLand using a command. I did not make any manual changes there.