{"id":14008128,"url":"https://github.com/quasilyte/yaml5","last_synced_at":"2025-03-19T10:30:52.737Z","repository":{"id":57545645,"uuid":"294013590","full_name":"quasilyte/yaml5","owner":"quasilyte","description":"YAML5 - use YAML like it's JSON5.","archived":false,"fork":false,"pushed_at":"2020-09-09T21:37:42.000Z","size":20,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T06:11:27.671Z","etag":null,"topics":["config","fmt","formatter","json5","lint","linter","yaml","yaml5"],"latest_commit_sha":null,"homepage":"","language":"Go","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/quasilyte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-09T05:38:42.000Z","updated_at":"2025-03-04T13:46:06.000Z","dependencies_parsed_at":"2022-09-26T18:40:33.181Z","dependency_job_id":null,"html_url":"https://github.com/quasilyte/yaml5","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Fyaml5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Fyaml5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Fyaml5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Fyaml5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quasilyte","download_url":"https://codeload.github.com/quasilyte/yaml5/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244407766,"owners_count":20447845,"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":["config","fmt","formatter","json5","lint","linter","yaml","yaml5"],"created_at":"2024-08-10T11:01:16.196Z","updated_at":"2025-03-19T10:30:52.475Z","avatar_url":"https://github.com/quasilyte.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# YAML5 - a JSON5* that is as widespread as YAML\n\n[YAML5](https://github.com/quasilyte/yaml5) is a way of writing [YAML](https://yaml.org/) files that makes them look like [JSON5](https://json5.org/). In other words: it's not a new format.\n\nThis repository provides a useful tooling for you:\n\n* `yaml5 lint` checks whether the YAML file complies with the YAML5 rules\n* `yaml5 fmt` reads a YAML file and pretty-prints it as a YAML5 file (not implemented yet)\n\n## YAML5 rules (tl;dr: it's JSON5 with a different comment syntax)\n\nThere is only one rule: your YAML file needs to be a valid JSON5 document.\n\nThe only difference is the single line comment syntax: use `#` instead of `//`.\n\nLet's take an example from the [json5.org](https://json5.org/):\n\n```yaml\n{\n  # comments\n  unquoted: 'and you can quote me on that',\n  singleQuotes: 'I can use \"double quotes\" here',\n  lineBreaks: \"Look, Mom! \\\nNo \\\\n's!\",\n  hexadecimal: 0xdecaf,\n  leadingDecimalPoint: .8675309, andTrailing: 8675309.,\n  positiveSign: +1,\n  trailingComma: 'in objects', andIn: ['arrays',],\n  \"backwardsCompatible\": \"with JSON\",\n}\n```\n\nThe `yaml5 lint` tool does catch some corner cases, for example, it does check that you've used a valid unquoted object key following the `ES5.1` rules.\n\nAll YAML documents that use features that are not part of the JSON5 format will be reported as errors:\n\n```\n$ cat bad.yml\nfoo: \n  - .inf\n  - 10\n\n$ yaml5 lint bad.yml\nbad.yml:1:4: used a key-value outside of an object\nbad.yml:2:3: use a flow array syntax instead\nbad.yml:2:5: infinity value should not be used\n```\n\n## Why you may want to use YAML5\n\n* You were searching for a \"JSON with comments and trailing commas\", but the [JSON5](https://json5.org/) is not so popular\n* You have a lot of YAML files but would like to keep them strict and free of the indentation-sensitive features\n\n## Installation\n\n```bash\n# The easiest way to build it from sources:\ngo get -u -v github.com/quasilyte/yaml5/cmd/yaml5\n\n# Build yaml5 binary from sources + embed the version info so the \"yaml5 version\"\n# can give an appropriate output. Note that GOBIN folder is set to the\n# current directory (the cloned yaml5 repository in this example); you can\n# choose any other binary destination.\ngit clone https://github.com/quasilyte/yaml5.git\ncd yaml5\nGOBIN=$(pwd) make\n```\n\n\u003e TODO: make a binary release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquasilyte%2Fyaml5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquasilyte%2Fyaml5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquasilyte%2Fyaml5/lists"}