{"id":38339239,"url":"https://github.com/longkai/kubernetes-yaml-formatter","last_synced_at":"2026-01-17T02:58:51.067Z","repository":{"id":62612188,"uuid":"537189459","full_name":"longkai/kubernetes-yaml-formatter","owner":"longkai","description":"Kubernetes Style YAML Formatter for Visual Studio Code","archived":false,"fork":false,"pushed_at":"2024-10-24T14:09:04.000Z","size":696,"stargazers_count":41,"open_issues_count":13,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-25T17:27:16.949Z","etag":null,"topics":["ansible","cicd","devops","formatter-plugin","github-actions","kubernetes","vscode-extension","yaml"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/longkai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-15T20:06:09.000Z","updated_at":"2024-10-01T20:00:13.000Z","dependencies_parsed_at":"2024-11-02T06:29:59.090Z","dependency_job_id":null,"html_url":"https://github.com/longkai/kubernetes-yaml-formatter","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/longkai/kubernetes-yaml-formatter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longkai%2Fkubernetes-yaml-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longkai%2Fkubernetes-yaml-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longkai%2Fkubernetes-yaml-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longkai%2Fkubernetes-yaml-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/longkai","download_url":"https://codeload.github.com/longkai/kubernetes-yaml-formatter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longkai%2Fkubernetes-yaml-formatter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","cicd","devops","formatter-plugin","github-actions","kubernetes","vscode-extension","yaml"],"created_at":"2026-01-17T02:58:50.987Z","updated_at":"2026-01-17T02:58:51.051Z","avatar_url":"https://github.com/longkai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Better YAML Formatter for Visual Studio Code\n\nA [Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=kennylong.kubernetes-yaml-formatter) that provides format support for [YAML](https://yaml.org) language.\n\nFrustrated of the builtin formatter with its own [option philosophy](https://prettier.io/docs/en/option-philosophy.html)?\n\nOr you guys comes from devops world where dealing with a lot of yaml everyday like kubernetes, ansible or helm template.\n\nAnd you have your own prefer style of YAML, e.g., **do not indent sequence elements** or other customization settings.\n\nThis extension is made for you :)\n\n## Features\n\nFormat **correct**, **consistent** and **customized** yaml text with **Better YAML Formatter**.\n\n### 🔥 Watch the demo video 👇\n\nhttps://github.com/user-attachments/assets/dfdec44b-221f-436d-9d90-413f0c0effe6\n\nTake the k8s yaml for example:\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: nginx-deployment\nspec:\n  selector:\n    matchLabels:\n      app: nginx\n  replicas: 2\n  template:\n    metadata:\n      labels:\n        app: nginx\n    spec:\n      containers:\n      - name: nginx\n        image: nginx:latest\n        ports:\n        - containerPort: 80\n```\n\nAs you see, the sequence style(`containers` and `ports`) in the k8s style yaml has no indent. Each time you play with [kubectl](https://kubernetes.io/docs/reference/kubectl/), there is no indent. Not to mention some tool like [kustomize](https://github.com/kubernetes-sigs/kustomize) [requires you do that](https://github.com/kubernetes-sigs/kustomize/issues/3946).\n\nUnluckily, the builtin yaml format has its own [option philosophy](https://prettier.io/docs/en/option-philosophy.html). It always does indent and [resists to accept](https://github.com/prettier/prettier/issues/12385) such a customization setting.\n\nIt's useless. I have to keep the style manually every time editing yaml files, or you will end up with a non-idiomatic one.\n\nIt's tedious. So I create this extension to make life easier.\n\n## Extension Settings\n\nThis extension contributes the following settings:\n\n* `better-yaml.directives`: Whether block sequences should be indented.\n* `better-yaml.directives`: Include directives in the output. If true, at least the document-start marker --- is always included. If false, no directives or marker is ever included. If null, directives and marker may be included if required.\n* `better-yaml.commentString`: Change the comment prefix string. By default, empty comment lines are left empty, lines consisting of a single space are replaced by `#`, and all other lines are prefixed with a `#`.\n* `better-yaml.lineWidth`: Maximum line width (set to 0 to disable folding). This is a soft limit, as only double-quoted semantics allow for inserting a line break in the middle of a word.\n* `better-yaml.flowCollectionPadding`: When true, a single space of padding will be added inside the delimiters of non-empty single-line flow collections.\n* `better-yaml.documentOptions.version`: The YAML version used by documents without a %YAML directive. Must be '1.1' or '1.2'. Default to '1.2'.\n\n## Thanks\n\nThanks [lupengpeng](https://github.com/iamlupeng1991) for the icon design. It's great!\n\nMany thanks the following projects:\n\n* [eemeli/yaml](https://github.com/eemeli/yaml)\n\nWithout them there wouldn't be this extension.\n\nThroughout the process I learnt a lot and also made some contributions back to them.\n\nDefinitely welcome your patches and contributions!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongkai%2Fkubernetes-yaml-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flongkai%2Fkubernetes-yaml-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongkai%2Fkubernetes-yaml-formatter/lists"}