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

Apply automatic formatting only to manifests #1506

Merged
merged 4 commits into from
Oct 17, 2023

Conversation

jsoriano
Copy link
Member

Modifies automation introduced in #1485 so it is only applied to manifests by now.

Applying it to other files like transforms or test configuration files may lead to obscure errors.

@jsoriano jsoriano requested a review from a team October 16, 2023 16:19
@jsoriano jsoriano self-assigned this Oct 16, 2023
@@ -126,3 +134,24 @@ func mergeNodes(node *yaml.Node) {

node.Content = node.Content[:k]
}

func quoteKeysWithDot(node *yaml.Node) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started applying this to test files, but this could also have unexpected results.

This is not used now, if we finally decide not to use it I will remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very confident to apply this transformation. Maybe just in transform.yml files ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, after some tests I think this one can be a bit misleading, I am more leaned to remove it, and apply only the automation for nested objects in manifests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

internal/formatter/yaml_formatter.go Show resolved Hide resolved
@@ -126,3 +134,24 @@ func mergeNodes(node *yaml.Node) {

node.Content = node.Content[:k]
}

func quoteKeysWithDot(node *yaml.Node) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very confident to apply this transformation. Maybe just in transform.yml files ?

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @jsoriano

@jsoriano jsoriano merged commit 97303ff into elastic:main Oct 17, 2023
@jsoriano jsoriano deleted the smarter-yaml-formatter branch October 17, 2023 13:48
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

Successfully merging this pull request may close these issues.

3 participants