More from YAMLClean
Guides
Frequently Asked Questions
Does YAMLClean send my config files to a server?
No. Cleaning and linting run in your browser, so Kubernetes manifests and CI configs with secrets in them never leave your machine.
Why does 027 parse as a number I did not expect?
YAML 1.1 treats a leading zero as octal, so 027 becomes 23. Quote values you mean as strings, and remember the same trap applies to version-like strings such as 1.10.
Does YAMLClean validate my YAML?
It lints rather than parses. The linter flags tabs in indentation, duplicate keys, a missing space after the colon, and unquoted values that YAML 1.1 turns into booleans, octal numbers or shortened floats. It will not catch every syntax error, so keep yamllint in CI for full coverage.
🧭 Pro Tips & Gotchas
What this does
- Strips trailing whitespace from each line and removes trailing blank lines. That is the whole job, and it is the fix for the single most common YAML CI complaint.
- It is intentionally cosmetic: no re-indentation, no key sorting, no quote normalisation.
YAML gotchas that are not cosmetic
- Tabs are illegal as indentation in YAML. One tab anywhere in the indentation makes the parser fail, and many editors will not show it.
:meta:with a tab after the colon is a real file people ship. yes,no,on,off,y,n,true,falseall parse as booleans in YAML 1.1 (which most tooling still uses). Ano:key or aon: truevalue is a footgun; Docker Compose and GitHub Actions have both bitten users here. Quote the string:"no".- Unquoted version strings lose the patch component:
version: 3.0becomes the float3, and1.10becomes1.1. Quote versions and semantic versions. - Leading zeros are octal in YAML 1.1:
zip: 012345silently becomes5097in decimal. Same trap for0755permissions in a config file. - A missing space after the colon (
key:value) is a parse error, not a style issue — butkey :with a trailing space before the colon is legal and reads like a typo. - Duplicate keys: most parsers take the last value without warning; strict ones error. GitHub Actions and Kubernetes disagree about which applies, so a duplicated
env:block can quietly override your secrets. <<: anchormerge keys and&anchor/aliasreuse are features, not corruption — do not "clean" them out.
For real validation
yamllint (lint rules, line numbers), python -c "import sys,yaml; yaml.safe_load(sys.stdin)" (parse check — and use safe_load, never yaml.load, which can execute arbitrary Python objects), or yq eval to see what the parser actually produced. If a value looks wrong in yq output, it is a quoting problem, not a whitespace one.