Autogenerating the configuration stub
This is more like a development suggestion, not a bug or feature request.
Currently when adding a new config key, you need to add the config key and default value to the default stub here: https://gitlab.com/profclems/cli/blob/main/internal/config/config_type.go#L157-295. Here is an example PR !1064 (merged) (You need to also modify the tests).
Should we automate that a bit? My suggestion is to create a separate file for the config stub and a lockfile. New configs are added to the lockfile and then run go generate
to generate the stub. The lockfile will be run against the stub in tests instead of manually adding the config key to the test.
internal
|__ config
|-- stub.go
|-- config.yaml.lock
|-- gen.go
|-- Readme.md
|__ config_test.go
Edited by Clement Sam