{"id":13414136,"url":"https://github.com/antham/ghokin","last_synced_at":"2025-04-10T03:55:07.922Z","repository":{"id":37548455,"uuid":"143419931","full_name":"antham/ghokin","owner":"antham","description":"Parallelized formatter with no external dependencies for gherkin (cucumber, behat...)","archived":false,"fork":false,"pushed_at":"2025-03-27T10:10:28.000Z","size":485,"stargazers_count":46,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T03:54:53.239Z","etag":null,"topics":["behat","cucumber","formatter","gherkin"],"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/antham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-08-03T11:36:35.000Z","updated_at":"2025-03-27T10:10:31.000Z","dependencies_parsed_at":"2023-11-06T10:27:08.974Z","dependency_job_id":"7dacf81f-70a3-4812-a74d-7212f30fea42","html_url":"https://github.com/antham/ghokin","commit_stats":{"total_commits":217,"total_committers":6,"mean_commits":"36.166666666666664","dds":0.6820276497695852,"last_synced_commit":"d3715fdbd487e5942efd08847a36f1a4083ade9d"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antham%2Fghokin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antham%2Fghokin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antham%2Fghokin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antham%2Fghokin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antham","download_url":"https://codeload.github.com/antham/ghokin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154999,"owners_count":21056542,"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":["behat","cucumber","formatter","gherkin"],"created_at":"2024-07-30T20:01:58.809Z","updated_at":"2025-04-10T03:55:07.896Z","avatar_url":"https://github.com/antham.png","language":"Go","readme":"# [![Go Report Card](https://goreportcard.com/badge/github.com/antham/ghokin)](https://goreportcard.com/report/github.com/antham/ghokin) [![codecov](https://codecov.io/gh/antham/ghokin/branch/master/graph/badge.svg)](https://codecov.io/gh/antham/ghokin) [![GitHub tag](https://img.shields.io/github/tag/antham/ghokin.svg)]()\n\nGhokin format and apply transformation on gherkin files.\n\n---\n\n- [Install](#install)\n- [Usage](#usage)\n- [Documentation](#documentation)\n- [Contribute](#contribute)\n\n---\n\n## Install\n\nDownload the latest binary for your achitecture [here](https://github.com/antham/ghokin/releases/latest).\n\nIf you can't find a binary for your architecture, install the go toolchain, clone the repository and run : `go install .`.\n\n## Usage\n\n```\nClean and/or apply transformation on gherkin files\n\nUsage:\n  ghokin [command]\n\nAvailable Commands:\n  check       Check a file/folder is well formatted\n  fmt         Format a feature file/folder\n  help        Help about any command\n\nFlags:\n      --config string   config file\n  -h, --help            help for ghokin\n\nUse \"ghokin [command] --help\" for more information about a command.\n```\n\n⚠️ Ghokin works only on `UTF-8` encoded files, it will detect and convert automatically files that are not encoded in this charset.\n\n### fmt stdout\n\nDump stdin or a feature file formatted on stdout\n\n```\nghokin fmt stdout features/test.feature\n```\n\nor\n\n```\ncat features/test.feature|ghokin fmt stdout\n```\n\n### fmt replace\n\nFormat and replace a file or all files in a directory\n\n```\nghokin fmt replace features/test.feature\n```\n\nor\n\n```\nghokin fmt replace features/\n```\n\n### check\n\nEnsure a file or all files in a directory are well formatted, exit with an error code otherwise\n\n```\nghokin check features/test.feature\n```\n\nor\n\n```\nghokin check features/\n```\n\n## Documentation\n\n### Shell commands\n\nYou can run shell commands from within your feature file to transform some datas with annotations, to do so you need first to define in the config an alias and afterwards you can simply \"comment\" the line before the line you want to transform with that alias.\nFor instance let say `@json` calls behind the curtain `jq`, we could validate and format some json in our feature like so :\n\n```\nFeature: A Feature\n  Description\n\n  Scenario: A scenario to test\n    Given a thing\n    # @json\n    \"\"\"\n    {\n      \"test\": \"test\"\n    }\n    \"\"\"\n```\n\n### Config\n\nDefaut config is to use 2 spaces for indentation.\n\nIt's possible to override configuration by defining a `.ghokin.yml` file in the home directory or in the current directory where we are running the binary from :\n\n```\nindent: 2\naliases:\n  json: \"jq .\"\n```\n\nAliases key defined [shell commands](#shell-commands) callable in comments as we discussed earlier.\n\nIt's possible to use environments variables instead of a static config file :\n\n```\nexport GHOKIN_INDENT=2\nexport GHOKIN_ALIASES='{\"json\":\"jq .\"}'\n```\n\n## Contribute\n\nIf you want to add a new feature to ghokin project, the best way is to open a ticket first to know exactly how to implement your changes in code.\n\n### Setup\n\nAfter cloning the repository you need to install vendors with `go mod vendor`\nTo test your changes locally you can run go tests with : `make test-all`\n","funding_links":[],"categories":["Utilities","公用事业公司","Utility","工具库`可以提升效率的通用代码库和工具`","工具库"],"sub_categories":["HTTP Clients","Utility/Miscellaneous","实用程序/Miscellaneous","查询语","Fail injection"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantham%2Fghokin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantham%2Fghokin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantham%2Fghokin/lists"}