yaml file sequence items spaces after hyphen
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.1k
- Forks
- 1.1k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Description
Ubuntu 18.04 and archlinux
sops v3.3.1
Have weird yaml thing, encrypted a file with lines that looks like
ENV:
- name: "AWS_KEY"
value: "BLAHBLAHBLAH"
- name: "AWS_REGION"
value: "eu-west-1"
... etc..
SO i do `sops --encrypt file.yaml --output > file-sops.yaml
then do sops --decrypt file-sops.yaml > file-dec.yaml
the decrypted file now has those lines looking like
ENV:
- name: AWS_KEY
value: BLAHBLAHBLAH
- name: AWS_REGION
value: eu-west-1
So, it's changed the yaml indent to 4 spaces, that's fine, it's in the spec,
But it's added 2 spaces to the 1 space that was between the key and the - for each sequence item key
yamlint blows up on this. though it doesn't cause issues in the python script that i then pass this config yaml to in my usecase, the CI issues yamllint causes are the problem.
The resulting yamllint output on my actual file in my environment, shows up like:
~$> yamllint myfile-dec.yaml
myfile-dec.yaml
1:1 warning missing document start "---" (document-start)
10:8 error too many spaces after hyphen (hyphens)
10:5 error wrong indentation: expected 8 but found 4 (indentation)
12:8 error too many spaces after hyphen (hyphens)
14:8 error too many spaces after hyphen (hyphens)
16:8 error too many spaces after hyphen (hyphens)
...etc...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with file.yaml, file-sops.yaml, and file-dec.yaml using the sops --encrypt and sops --decrypt commands shown. Compare the decrypted sequence formatting with yamllint output; done means decryption preserves valid sequence indentation without extra spaces after hyphens.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, yaml
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100