Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Assignees
Labels
criticality: lowOf low impact priority: mediumResolution is a medium priority topic: CLIRelated to the command line interface topic: codeRelated to content of the project itself type: enhancementProposed improvement
@silvanocerza

Description

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 impact priority: mediumResolution is a medium priority topic: CLIRelated to the command line interface topic: codeRelated to content of the project itself type: enhancementProposed improvement

Type

No type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /