mirror of https://github.com/open-feature/cli.git
closes #87 ## This PR This update introduces the addition of stability information to the generated markdown content for commands in our CLI. The changes include a new function, `addStabilityToMarkdown`, which checks if a command has a 'stability' annotation and adds it to the markdown content accordingly. This function is then used in both `generate.go` and `init.go`. Additionally, formatting adjustments were made in `root.go` for better readability. ### Notes - Some of the logic felt a bit astonishing, so I left a lot of comments. If this isn't helpful, I'd be happy to remove them. - I tried to approach this in a way where the addedStabilityInfo was inherent and not imperative. - There is still one imperative func that needs to be used in each command, I would be open to suggestions to eliminate it. - The logic for customizing the markdown should work for any command we implement in the future. - I was going to try and use go templating to achieve this, but ended up going with a 'mutate after the fact' approach. - This approach could be utilized in the future to customize the docs further, but the logic to do so is very procedural. In the future, I would like to think up a more declarative approach, I think this could improve it so it's more easily extensible and less to maintain. ### Follow-up Tasks - Possibly introduce a more declarative approach so we can extend markdown customization more easily in the future, without having to write additional logic to figure out where to place the custom content. ### How to test - [ ] run `make generate-docs` and you should see the stability info output in the docs. Change or add a new stability info to a command, try it, and you should see the changes updated. Signed-off-by: Kris Coleman <kriscodeman@gmail.com> |
||
|---|---|---|
| .. | ||
| testdata | ||
| config.go | ||
| config_test.go | ||
| generate.go | ||
| generate_test.go | ||
| init.go | ||
| root.go | ||
| utils.go | ||
| version.go | ||