Skip to content

Unmarshal settings to known struct instead of using a Viper singleton #1355

Open
@silvanocerza

Description

@silvanocerza

Enhancement

Currently the CLI uses a *viper.Viper singleton in the github.com/arduino/arduino-cli/configuration package to store all the configs, no validation is done when reading the config file but only when editing the config with the config command.

A great enhancement would be to unmarshal the config file using Viper to a known struct, this way we won't have a viper.Viper singleton since it causes some problems and makes it hard to embed certain parts of the CLI, also it will be easier to validate the data read from the config file. Probably it will also enhance writing to file but am not sure. 🤔

This has been inspired by this Fosdem 2019 talk by @carolynvs: https://youtu.be/l89Z0RYseFs?t=1009

Metadata

Metadata

Assignees

Labels

criticality: lowOf low impactpriority: mediumResolution is a medium prioritytopic: CLIRelated to the command line interfacetopic: codeRelated to content of the project itselftype: enhancementProposed improvement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions