Skip to content

Obtain --indent global flag value and pass it to store configs#2156

Merged
felixfontein merged 1 commit intogetsops:mainfrom
skirino:honor_indent_global_flag
Apr 23, 2026
Merged

Obtain --indent global flag value and pass it to store configs#2156
felixfontein merged 1 commit intogetsops:mainfrom
skirino:honor_indent_global_flag

Conversation

@skirino
Copy link
Copy Markdown
Contributor

@skirino skirino commented Apr 23, 2026

To change number of spaces per indent level by command line flag. The current version (3.12.2) neglects --indent flag.
(Setting indent in .sops.yaml works as expected.)

To reproduce:

  • Suppose I have an encrypted file (with age):

    $ age-keygen >key
    $ cat plain.json
    {
      "a": "b"
    }
    $ sops encrypt --age "$(age-keygen -y key)" plain.json --output enc.json
    
  • Decrypting the file with and without --indent=2 gives the same output (indented with TABs in both cases):

    $ SOPS_AGE_KEY_FILE=key sops --indent=2 decrypt enc.json
    {
    	"a": "b"
    }
    $ SOPS_AGE_KEY_FILE=key sops decrypt enc.json
    {
    	"a": "b"
    }
    

Signed-off-by: Shunsuke Kirino <shunsuke.kirino@gmail.com>
@skirino skirino force-pushed the honor_indent_global_flag branch from dfeb967 to 092062a Compare April 23, 2026 04:28
Copy link
Copy Markdown
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for reporting and fixing this!

@felixfontein felixfontein merged commit ac1e113 into getsops:main Apr 23, 2026
15 checks passed
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.

2 participants