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

Alloy fmt use "space" instead of "tab" for indentation #915

Open
duthifree opened this issue May 23, 2024 · 1 comment
Open

Alloy fmt use "space" instead of "tab" for indentation #915

duthifree opened this issue May 23, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@duthifree
Copy link

Request

Is it possible to change indentation from "tab" to "space" when i use alloy fmt please ?

Use case

In Kubernetes, when i create ConfigMap from file, \n... are prints instead of a newline. It's hard to edit or consult ConfigMap with this formatting.

Today:

apiVersion: v1
data:
  test.alloy: "test.example \"xxx\" {\n\foo = \"bar\"\n}\n"
kind: ConfigMap
metadata:
  name: alloy
  namespace: grafana-alloy

Expected :

apiVersion: v1
data:
  test.alloy: |
    test.example "xxx" {
      foo = "bar"
    }
kind: ConfigMap
metadata:
  name: alloy
  namespace: grafana-alloy
@duthifree duthifree added the enhancement New feature or request label May 23, 2024
@csh0101
Copy link

csh0101 commented May 28, 2024

I think this maybe cause by the terminator is '\n'? maybe it need to add terminator judge for '\t'
https://grafana.com/docs/alloy/latest/concepts/configuration-syntax/syntax/#:~:text=Terminators,as%20you%20want.

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

No branches or pull requests

2 participants