Skip to content

2.59 broke some tabs in config #4323

@eugenesvk

Description

@eugenesvk

Describe the bug

Since 2.59 my config broke, on chezmoi init command for the simplified file below I get a value is not allowed in this context which I managed to track down to a tab separating key and :, though strangely enough, tabs in other key⭾:value pairs work

To reproduce

There are 2 tabs in this file, one after bugTab which generates an error, replacing it with space fixes the error, another one after Oktab, which doesn't generate an error and doesn't need replacement

#chezmoi:template:left-delimiter="#‹" right-delimiter="›"
follow    : true
format    : 'yaml'
data:
  bugTab	: 's'
  vars:
    Oktab	: 'a'

Generates the error

.chezmoi.yaml.tmpl: [5:3] value is not allowed in this context
   2 | format    : 'yaml'
   3 | data: 4 |   bugTab       : 's'
>  5 |   vars: ^
   6 |     Oktab        : 'a'

Don't understand why 4 line number isn't a separate line, but glued to the previous one

As mentioned above, repacing

  bugTab	: 's'

with

  okSpace : 's'

works

Expected behavior

Config working as before with a mix of tabs and spaces

Output of command with the --verbose flag

$ chezmoi --verbose init
.chezmoi.yaml.tmpl: [5:3] value is not allowed in this context
   2 | format    : 'yaml'
   3 | data: 4 |   bugTab       : 's'
>  5 |   vars: ^
   6 |     Oktab        : 'a'

Output of chezmoi doctor

$ chezmoi doctor
RESULT    CHECK                       MESSAGE
ok        version                     v2.60.0, commit 3442bd4f409f0120a90663679c08703684fb5606, built at 2025-02-24T00:11:29Z, built by goreleaser
ok        latest-version              v2.60.0
ok        os-arch                     windows/amd64
ok        systeminfo                  Microsoft Windows 11 IoT Enterprise LTSC (10.0.26100 N/A Build 26100)
ok        go-version                  go1.24.0 (gc)
ok        executable                  D:/App/scoop/apps/chezmoi/current/chezmoi.exe
ok        config-file                 found ~/.config/chezmoi/chezmoi.yaml, last modified 2025-03-05T22:08:04+02:00
warning   source-dir                  ~/.local/share/chezmoi is a git working tree (dirty)
ok        suspicious-entries          no suspicious entries
warning   working-tree                ~/.local/share/chezmoi is a git working tree (dirty)
ok        dest-dir                    ~ is a directory
ok        cd-command                  found C:/WINDOWS/system32/cmd.exe
ok        cd-args                     'C:\\WINDOWS\\system32\\cmd.exe'
info      diff-command                not set
ok        edit-command                found C:/WINDOWS/system32/notepad.exe
ok        edit-args                   'C:\\WINDOWS\\system32\\notepad.exe'
ok        git-command                 found D:/App/scoop/shims/git.exe, version 2.48.1
warning   merge-command               vimdiff not found in $PATH
ok        shell-command               found C:/WINDOWS/system32/cmd.exe
ok        shell-args                  'C:\\WINDOWS\\system32\\cmd.exe'
ok        age-command                 found D:/App/scoop/shims/age.exe, version 1.2.1
ok        gpg-command                 found C:/Program Files (x86)/0 Secure/1 Defend/GnuPG/bin/gpg.exe, version 2.4.7
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

Additional context

Couldn't find anything in the changes nor in commit titles or anything

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingin dependencyIn a dependency, not in chezmoi

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions