google / google/yamlfmt

Preserve multiline for line ending with \

Open
#137 4 comments 5 reactions 0 assignees View on GitHub
yaml_v3_problem
Dominant language
Go
Stars
1.8k
Forks
75
PR merge metrics
No merged PRs in 30d

Description

Hey. I have the next yaml.

What is the best way to preserve multiline for the `regex` value?

I cannot use `>` `scan_folded_as_literal` because there will be spaces between elements.

```
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMNodeScrape
metadata:
name: kubelet
spec:
metricRelabelConfigs:
- action: labeldrop
regex: (uid)
- action: labeldrop
regex: (id|name)
- action: keep
regex: "go_goroutines|\
kubelet_cgroup_manager_duration_seconds_bucket|\
kubelet_cgroup_manager_duration_seconds_count|\
kubelet_node_config_error|\
kubelet_node_name|\
node_quantile:kubelet_pleg_relist_duration_seconds:histogram_quantile|\
kubelet_pleg_relist_duration_seconds_bucket|\
kubelet_pleg_relist_duration_seconds_count|\
kubelet_pleg_relist_interval_seconds_bucket|\
kubelet_certificate_manager_client_ttl_seconds|\
kubelet_certificate_manager_client_expiration_renew_errors|\
kubelet_certificate_manager_server_ttl_seconds|\
kubelet_pod_start_duration_seconds_bucket|\
kubelet_pod_start_duration_seconds_count|\
kubelet_pod_worker_duration_seconds_bucket|\
kubelet_pod_worker_duration_seconds_count|\
kubelet_server_expiration_renew_errors|\
kubelet_running_containers|\
kubelet_running_container_count|\
kubelet_running_pods|\
kubelet_running_pod_count|\
kubelet_runtime_operations_errors_total|\
kubelet_runtime_operations_total|\
kubelet_volume_stats_available_bytes|\
kubelet_volume_stats_capacity_bytes|\
kubelet_volume_stats_inodes|\
kubelet_volume_stats_inodes_used|\
process_cpu_seconds_total|\
rest_client_request_duration_seconds_bucket|\
rest_client_requests_total|\
storage_operation_duration_seconds_count|\
storage_operation_errors_total|\
kubernetes_build_info|\
volume_manager_total_volumes|\
process_resident_memory_bytes"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.