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

chezmoi data -f yaml incorrectly renders "\n" as |4+ #3594

Closed
ErrrorMaxx opened this issue Feb 24, 2024 · 1 comment
Closed

chezmoi data -f yaml incorrectly renders "\n" as |4+ #3594

ErrrorMaxx opened this issue Feb 24, 2024 · 1 comment
Labels
bug Something isn't working in dependency In a dependency, not in chezmoi won't fix This will not be worked on

Comments

@ErrrorMaxx
Copy link

ErrrorMaxx commented Feb 24, 2024

Describe the bug

chezmoi data -f yaml incorrectly renders "\n" as |4+

To reproduce

In .chezmoi.yaml.tmpl:

data:
  NL: "\n"

Run chezmoi data -f yaml

Expected behavior

"\n" rendered as "\n" (like "\t" which properly renders as "\t")

Output of command with the --verbose flag

$ chezmoi --verbose data -f yaml
NL: |4+
chezmoi:
...

Output of chezmoi doctor

$ chezmoi doctor
RESULT    CHECK                       MESSAGE
warning   version                     v2.46.1
ok        latest-version              v2.46.1
ok        os-arch                     android/arm64
ok        uname                       Linux localhost 4.19.191+ #1 SMP PREEMPT Wed Nov 29 21:44:22 CST 2023 aarch64 Android
ok        go-version                  go1.21.6 (gc)
ok        executable                  /data/data/com.termux/files/usr/bin/chezmoi
ok        config-file                 ~/.config/chezmoi/chezmoi.yaml, last modified 2024-02-24T11:50:36Z
ok        source-dir                  ~/.local/share/chezmoi is a git working tree (clean)
ok        suspicious-entries          no suspicious entries
ok        working-tree                ~/.local/share/chezmoi is a git working tree (clean)
ok        dest-dir                    ~ is a directory
warning   umask                       077
ok        cd-command                  found /data/data/com.termux/files/usr/bin/zsh
ok        cd-args                     /data/data/com.termux/files/usr/bin/zsh
info      diff-command                not set
ok        edit-command                found /data/data/com.termux/files/usr/bin/micro
ok        edit-args                   micro
ok        git-command                 found /data/data/com.termux/files/usr/bin/git, version 2.43.2
warning   merge-command               vimdiff not found in $PATH
ok        shell-command               found /data/data/com.termux/files/usr/bin/zsh
ok        shell-args                  /data/data/com.termux/files/usr/bin/zsh
info      age-command                 age not found in $PATH
ok        gpg-command                 found /data/data/com.termux/files/usr/bin/gpg, version 2.4.4
info      pinentry-command            not set
info      1password-command           op not found in $PATH
info      bitwarden-command           bw not found in $PATH
info      bitwarden-secrets-command   bws not found in $PATH
info      dashlane-command            dcli not found in $PATH
info      doppler-command             doppler not found in $PATH
info      gopass-command              gopass not found in $PATH
info      keepassxc-command           keepassxc-cli not found in $PATH
info      keepassxc-db                not set
info      keeper-command              keeper not found in $PATH
info      lastpass-command            lpass not found in $PATH
info      pass-command                pass not found in $PATH
info      passhole-command            ph not found in $PATH
info      rbw-command                 rbw not found in $PATH
info      vault-command               vault not found in $PATH
info      vlt-command                 vlt not found in $PATH
info      secret-command              not set
@twpayne twpayne added bug Something isn't working in dependency In a dependency, not in chezmoi labels Feb 24, 2024
@twpayne
Copy link
Owner

twpayne commented Feb 24, 2024

This is go-yaml/yaml#1004.

This bug is in a dependency of chezmoi and cannot be fixed in chezmoi itself. chezmoi's dependencies are regularly updated and so when this is fixed in the dependency chezmoi will get the fix soon after. So, I will close this as won't fix.

Note, however, that if you have a template variable for newlines you should probably be using a template line ending directive instead, i.e. your templates should contain

chezmoi:template:line-endings=native

@twpayne twpayne closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2024
@twpayne twpayne added the won't fix This will not be worked on label Feb 24, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working in dependency In a dependency, not in chezmoi won't fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants