{"id":17000422,"url":"https://github.com/pascalre/vscode-yaml-sort","last_synced_at":"2025-03-15T14:30:46.282Z","repository":{"id":38443763,"uuid":"183470161","full_name":"pascalre/vscode-yaml-sort","owner":"pascalre","description":"This VS Code extension exposes the possibility to sort, format and validate yaml files.","archived":false,"fork":false,"pushed_at":"2024-10-23T20:18:36.000Z","size":5692,"stargazers_count":41,"open_issues_count":44,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-10-24T17:37:24.025Z","etag":null,"topics":["sort","visual-studio-code","vscode","yaml","yaml-format","yaml-sort","yaml-sorting","yaml-validator"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=PascalReitermann93.vscode-yaml-sort","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/pascalre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2019-04-25T16:19:45.000Z","updated_at":"2024-06-29T02:14:35.000Z","dependencies_parsed_at":"2023-10-21T22:28:08.928Z","dependency_job_id":"c071c2a0-9e80-4ab4-a5ce-6e7a70c1105a","html_url":"https://github.com/pascalre/vscode-yaml-sort","commit_stats":null,"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalre%2Fvscode-yaml-sort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalre%2Fvscode-yaml-sort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalre%2Fvscode-yaml-sort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalre%2Fvscode-yaml-sort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pascalre","download_url":"https://codeload.github.com/pascalre/vscode-yaml-sort/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243742638,"owners_count":20340676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["sort","visual-studio-code","vscode","yaml","yaml-format","yaml-sort","yaml-sorting","yaml-validator"],"created_at":"2024-10-14T04:12:01.974Z","updated_at":"2025-03-15T14:30:46.275Z","avatar_url":"https://github.com/pascalre.png","language":"TypeScript","readme":"# YAML Sort\nYAML Sort extends VS Code to sort, format and validate YAML files.\n\n[![Coverage Status](https://coveralls.io/repos/github/pascalre/vscode-yaml-sort/badge.svg?branch=master)](https://coveralls.io/github/pascalre/vscode-yaml-sort?branch=master)\n[![GitHub issues open](https://img.shields.io/github/issues/pascalre/vscode-yaml-sort.svg)](https://github.com/pascalre/vscode-yaml-sort/issues)\n\n## Preview\n![Preview](images/preview.gif)\n\n# 💬 Commands\nThis extension contributes the following commands:\n\n| Command                                        | Description                                                                                                           |\n|------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|\n| `Custom Sort 1`                                | This command will sort a given YAML with custom order. If some of the keys of `customSortKeywords_1` will be found at the top level of the YAML, these will be put at the beginning of the YAML file (in the given order). You can use this e. g. to sort Kubernetes configmaps. |\n| `Custom Sort 2`                                | Same as `Custom Sort 1`                                                                                               |\n| `Custom Sort 3`                                | Same as `Custom Sort 1`                                                                                               |\n| `Format Document`                              | Formats a yaml document without sorting it. Also possible using the shortcut (⇧⌥F on Mac). |\n| `Recursively sort YAML files`                  | Sorts all `.yaml` and `.yml` files in a directory and all its subdirectories.                                         |\n| `Sort YAML`                                    | Sorts a given YAML. You can either sort the whole YAML document or sort only a selection of the text.                 |\n| `Validate YAML`                                | Validates a given YAML.                                                                                               |\n\n# ⚙️ Configuration\nThis extension contributes the following settings:\n\n| Setting                    | Description                                                                                                                                                      | Default          |\n|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------- |\n| `emptyLinesUntilLevel`     | When bigger than `0`, will add a new line before each keyword on level n.                                                                                        | `0`              |\n| `customSortKeywords_1`     | List of keywords for `Custom Sort 1`                                                                                                                             | `[\"apiVersion\", \"kind\", \"metadata\", \"spec\", \"data\"]`|\n| `customSortKeywords_2`     | List of keywords for `Custom Sort 2`                                                                                                                             | -                |\n| `customSortKeywords_3`     | List of keywords for `Custom Sort 3`                                                                                                                             | -                |\n| `extensions`               | Extensions to be processed with command `Recursively sort YAML files`                                                                                            | `[\"yaml\", \"yml\"]` |\n| `forceQuotes`              | When `true`, all non-key strings will be quoted even if they normally don't need to.                                                                             | `false`          |\n| `indent`                   | Indentation width in spaces                                                                                                                                      | `2`              |\n| `lineWidth`                | Maximum line width for YAML files                                                                                                                                | `500`            |\n| `locale`                   | Language whose sort order should be used                                                                                                                         | `en`             |\n| `noArrayIndent`            | When `true`, will not add an indentation level to array elements.                                                                                                | `false`          |\n| `noCompatMode`             | When `true`, don't try to be compatible with older yaml versions. Currently: don't quote \"yes\", \"no\" and so on, as required for YAML 1.1                         | `false`          |\n| `notifySuccess`            | When `true`, will notify on successfully performed tasks.                                                                                                        | `true`           |\n| `quotingType`              | Strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters.                    | `'`              |\n| `schema`                   | Schema to use. Possible values are `HOMEASSISTANT_SCHEMA`, `CLOUDFORMATION_SCHEMA`, `CORE_SCHEMA`, `DEFAULT_SCHEMA`, `FAILSAFE_SCHEMA`, `JSON_SCHEMA`.           | `DEFAULT_SCHEMA` |\n| `sortArrays`               | When `true`, will sort arrays                                                                                                                                   | `false`          |\n| `sortOnSave`               | When `0`, will sort files when saving document. When `1`, `2` or `3`, will use customSortKeywords. Set to negative value to disable sortOnSave. Only works in combination with `editor.formatOnSave` set to `true`. | `0`           |\n| `sortOrderReverse`         | When `true`, will sort in reverse order | `false`           |\n| `useAsFormatter`           | When `true`, will enable default YAML formatter (requires restart).                                                                                              | `false`          |\n| `useCustomSortRecursively` | When `true`, will use the custom sort keywords recursively on a file, when using custom sort.                                                                    | `false`          |\n| `useLeadingDashes`         | When `true`, sorted YAML files begin with leading dashes.                                                                                                        | `true`           |\n| `useArrayProcessor`        | When `true`, will activate ArrayProcessor.                                                                                                                       | `true`           |\n| `useBlockProcessor`        | When `true`, will activate BlockProcessor.                                                                                                                       | `true`           |\n| `useCommentProcessor`      | When `true`, will activate CommentProcessor.                                                                                                                     | `true`           |\n| `useHelmProcessor`         | When `true`, will activate HelmProcessor.                                                                                                                        | `true`           |\n| `useOctalProcessor`        | When `true`, will activate OctalProcessor.                                                                                                                       | `true`           |\n\n# ❓ FAQ\n## How to sort on save?\nRegister this extension as VS Code formatter. Also configure VS Code to format files on save. Caution: This setting will apply for all files. Changes will require a restart of VS Code. If you wish to also sort (not only format) the file on saving, set `sortOnSave` to `0`. Use `1`, `2` or `3` for custom sort.\n\n#### **`.vscode/settings.json`**\n```json\n{    \n    \"editor.formatOnSave\": true,\n    \"vscode-yaml-sort.sortOnSave\": 0\n}\n```\n\n## What are the processors doing and how do I use them?\nThere are different types of processors. If you experience any issues with them, or just don't want to use them, you can turn them off.\n\n### ArrayProcessor\nThe ArrayProcessor will not add linebreaks to single-line array structures.\n\n\u003ctable width=\"100%\"\u003e\n    \u003ctr\u003e\n        \u003cth width=\"33.3%\"\u003eOriginal Document\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003euseArrayProcessor: true\u003c/code\u003e\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003euseArrayProcessor: false\u003c/code\u003e\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003etest: [ \"CMD\", \"pg_isready\"]\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003etest: [ \"CMD\", \"pg_isready\"]\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003etest:\u003cbr\u003e- \"CMD\"\u003cbr\u003e- \"pg_isready\"\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n### BlockProcessor\nThe BlockProcessor will keep block sequences.\n\n\u003ctable width=\"100%\"\u003e\n    \u003ctr\u003e\n        \u003cth width=\"33.3%\"\u003eOriginal Document\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003euseBlockProcessor: true\u003c/code\u003e\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003euseBlockProcessor: false\u003c/code\u003e\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003ehello: |-\u003cbr\u003e\u0026nbsp;\u0026nbsp;World\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003ehello: |-\u003cbr\u003e\u0026nbsp;\u0026nbsp;World\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003ehello: World\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n### Comment Processor\nAn activated Comment Processor will keep comments while sorting.\n\n\u003ctable width=\"100%\"\u003e\n    \u003ctr\u003e\n        \u003cth width=\"33.3%\"\u003eOriginal Document\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003euseCommentProcessor: true\u003c/code\u003e\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003euseCommentProcessor: false\u003c/code\u003e\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003e# comment\u003cbr\u003efoo: bar\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e# comment\u003cbr\u003efoo: bar\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003efoo: bar\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n### Helm Processor\nThe Helm Processor makes the extension compatible with Helm charts.\n\n\u003ctable width=\"100%\"\u003e\n    \u003ctr\u003e\n        \u003cth width=\"33.3%\"\u003eOriginal Document\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003euseHelmProcessor: true\u003c/code\u003e\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003euseHelmProcessor: false\u003c/code\u003e\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003efoo: {{ .value }}\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003efoo: {{ .value }}\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003efoo:\u003cbr\u003e  '[object Object]': null\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n### Spacing Processor\nThe Spacing Processor will add spacing between keywords.\n\n\u003ctable width=\"100%\"\u003e\n    \u003ctr\u003e\n        \u003cth width=\"33.3%\"\u003eOriginal Document\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003eemptyLinesUntilLevel: 0\u003c/code\u003e\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003eemptyLinesUntilLevel: 1\u003c/code\u003e\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003efoo: bar\u003cbr\u003ebaz: bar\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003efoo: bar\u003cbr\u003ebaz: bar\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003efoo: bar\u003cbr\u003e\u003cbr\u003ebaz: bar\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n### Octal Processor\nThe Octal Processor makes the extension keeping octal value like 0744.\n\n\u003ctable width=\"100%\"\u003e\n    \u003ctr\u003e\n        \u003cth width=\"33.3%\"\u003eOriginal Document\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003euseOctalProcessor: true\u003c/code\u003e\u003c/th\u003e\n        \u003cth width=\"33.3%\"\u003eSorted with\u003cbr\u003e\u003ccode\u003euseOctalProcessor: false\u003c/code\u003e\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003efoo: 0744\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003efoo: 0744\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003efoo: 484\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n# 🎉 Support\n\nIf you like YAML Sort, please feel free to [rate it](https://marketplace.visualstudio.com/items?itemName=PascalReitermann93.vscode-yaml-sort\u0026ssr=false#review-details) on the marketplace.\n\nIf you miss something or found a bug, please let me know and [open an issue](https://github.com/pascalre/vscode-yaml-sort/issues/new) on this project on GitHub. Do not hesitate to open a pull request with your changes.\n\nCheck [open issues](https://github.com/pascalre/vscode-yaml-sort/issues) on GitHub.\n\n## Known problems\n\nBe careful with anchors and references, these don't work very well in this extension.\n\n# 📝 License\n\nYAML Sort is licensed under the [MIT License](https://raw.githubusercontent.com/pascalre/vscode-yaml-sort/master/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalre%2Fvscode-yaml-sort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpascalre%2Fvscode-yaml-sort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalre%2Fvscode-yaml-sort/lists"}