Skip to content

Commit f0cab1b

Browse files
silvanocerzaper1234
andcommitted
Code review fixes
Co-authored-by: per1234 <[email protected]>
1 parent 2af3de5 commit f0cab1b

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

Diff for: cli/config/validate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var validMap = map[string]reflect.Kind{
3535
"metrics.enabled": reflect.Bool,
3636
"network.proxy": reflect.String,
3737
"network.user_agent_ext": reflect.String,
38-
"updater.disable_notification": reflect.Bool,
38+
"updater.enable_notification": reflect.Bool,
3939
}
4040

4141
func typeOf(key string) (reflect.Kind, error) {

Diff for: cli/updater/updater.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
var tr = i18n.Tr
3434

3535
// CheckForUpdate returns the latest available version if greater than
36-
// the one running and it makes sense to check for an udpate, nil in all other cases
36+
// the one running and it makes sense to check for an update, nil in all other cases
3737
func CheckForUpdate(currentVersion *semver.Version) *semver.Version {
3838
if !shouldCheckForUpdate(currentVersion) {
3939
return nil
@@ -71,7 +71,7 @@ func checkForUpdate(currentVersion *semver.Version) *semver.Version {
7171
// NotifyNewVersionIsAvailable prints information about the new latestVersion
7272
func NotifyNewVersionIsAvailable(latestVersion string) {
7373
feedback.Errorf("\n\n%s %s → %s\n%s",
74-
ansi.Color(tr("A new release of arduino-cli is available:"), "yellow"),
74+
ansi.Color(tr("A new release of Arduino CLI is available:"), "yellow"),
7575
ansi.Color(globals.VersionInfo.VersionString, "cyan"),
7676
ansi.Color(latestVersion, "cyan"),
7777
ansi.Color("https://arduino.github.io/arduino-cli/latest/installation/#latest-packages", "yellow"))
@@ -85,8 +85,8 @@ func shouldCheckForUpdate(currentVersion *semver.Version) bool {
8585
return false
8686
}
8787

88-
if configuration.Settings.GetBool("updater.disable_notification") {
89-
// Don't check if the user disable the notification
88+
if !configuration.Settings.GetBool("updater.enable_notification") {
89+
// Don't check if the user disabled the notification
9090
return false
9191
}
9292

Diff for: configuration/defaults.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func SetDefaults(settings *viper.Viper) {
5050
settings.SetDefault("metrics.addr", ":9090")
5151

5252
// updater settings
53-
settings.SetDefault("updater.disable_notification", false)
53+
settings.SetDefault("updater.enable_notification", true)
5454

5555
// Bind env vars
5656
settings.SetEnvPrefix("ARDUINO")

Diff for: docs/configuration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- `always_export_binaries` - set to `true` to make [`arduino-cli compile`][arduino-cli compile] always save binaries
2626
to the sketch folder. This is the equivalent of using the [`--export-binaries`][arduino-cli compile options] flag.
2727
- `updater` - configuration options related to Arduino CLI updates
28-
- `disable_notification` - set to `true` to disable notifications of new Arduino CLI releases, defaults to `false`
28+
- `enable_notification` - set to `false` to disable notifications of new Arduino CLI releases, defaults to `true`
2929

3030
## Configuration methods
3131

Diff for: docs/installation.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.
4141
```
4242

4343
The Arduino CLI verifies every 24 hours if there are new releases, if you don't like this behaviour you can disable it
44-
by setting the `updater.disable_notification` config or the env var `ARDUINO_UPDATER_DISABLE_NOTIFICATION` to `true`.
44+
by setting the [`updater.enable_notification` config](configuration.md#configuration-keys) or the
45+
[env var `ARDUINO_UPDATER_ENABLE_NOTIFICATION`](configuration.md#environment-variables) to `false`.
4546

4647
### Download
4748

Diff for: i18n/data/en.po

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ msgid "--git-url and --zip-path flags allow installing untrusted files, use it a
111111
msgstr "--git-url and --zip-path flags allow installing untrusted files, use it at your own risk."
112112

113113
#: cli/updater/updater.go:74
114-
msgid "A new release of arduino-cli is available:"
115-
msgstr "A new release of arduino-cli is available:"
114+
msgid "A new release of Arduino CLI is available:"
115+
msgstr "A new release of Arduino CLI is available:"
116116

117117
#: cli/core/download.go:36
118118
#: cli/core/install.go:37

Diff for: i18n/rice-box.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)