From 505254f5c9f8d65671841c9c1572ba99eace2695 Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Wed, 28 Jun 2023 16:34:24 -0700 Subject: [PATCH 1/6] Deliberate typo Signed-off-by: Eric Promislow --- background.ts | 4 ++-- bats/tests/containers/auto-start.bats | 6 +++--- pkg/rancher-desktop/assets/specs/command-api.yaml | 2 +- .../components/Preferences/ApplicationBehavior.vue | 6 +++--- .../config/__tests__/commandLineOptions.spec.ts | 2 +- pkg/rancher-desktop/config/settings.ts | 4 ++-- pkg/rancher-desktop/main/commandServer/settingsValidator.ts | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/background.ts b/background.ts index ee2a8e88090..2368736344c 100644 --- a/background.ts +++ b/background.ts @@ -132,7 +132,7 @@ mainEvents.on('settings-update', async(newSettings) => { } await pathManager.enforce(); - if (newSettings.application.hideNotificationIcon) { + if (newSettings.application.hideNotivicationIcon) { Tray.getInstance(cfg).hide(); } else { if (firstRunDialogComplete) { @@ -262,7 +262,7 @@ Electron.app.whenReady().then(async() => { iconPath: path.join(paths.resources, 'icons', 'logo-square-512.png'), }); - if (!cfg.application.hideNotificationIcon) { + if (!cfg.application.hideNotivicationIcon) { Tray.getInstance(cfg).show(); } diff --git a/bats/tests/containers/auto-start.bats b/bats/tests/containers/auto-start.bats index 9ee25798f60..8a44d6ef67a 100644 --- a/bats/tests/containers/auto-start.bats +++ b/bats/tests/containers/auto-start.bats @@ -18,7 +18,7 @@ load '../helpers/load' run get_setting '.application.window.quitOnClose' assert_success assert_output false - run get_setting '.application.hideNotificationIcon' + run get_setting '.application.hideNotivicationIcon' assert_success assert_output false } @@ -101,14 +101,14 @@ load '../helpers/load' @test 'Enable hide-notification-icon' { rdctl set --application.hide-notification-icon=true - run get_setting '.application.hideNotificationIcon' + run get_setting '.application.hideNotivicationIcon' assert_success assert_output true } @test 'Disable hide-notification-icon' { rdctl set --application.hide-notification-icon=false - run get_setting '.application.hideNotificationIcon' + run get_setting '.application.hideNotivicationIcon' assert_success assert_output false } diff --git a/pkg/rancher-desktop/assets/specs/command-api.yaml b/pkg/rancher-desktop/assets/specs/command-api.yaml index 27b9b6ab01f..deb6be7402e 100644 --- a/pkg/rancher-desktop/assets/specs/command-api.yaml +++ b/pkg/rancher-desktop/assets/specs/command-api.yaml @@ -399,7 +399,7 @@ components: startInBackground: type: boolean x-rd-usage: start app without window - hideNotificationIcon: + hideNotivicationIcon: type: boolean x-rd-usage: don't show notification icon window: diff --git a/pkg/rancher-desktop/components/Preferences/ApplicationBehavior.vue b/pkg/rancher-desktop/components/Preferences/ApplicationBehavior.vue index 353f8e2ba39..8bc5c063cd2 100644 --- a/pkg/rancher-desktop/components/Preferences/ApplicationBehavior.vue +++ b/pkg/rancher-desktop/components/Preferences/ApplicationBehavior.vue @@ -65,9 +65,9 @@ export default Vue.extend({ > diff --git a/pkg/rancher-desktop/config/__tests__/commandLineOptions.spec.ts b/pkg/rancher-desktop/config/__tests__/commandLineOptions.spec.ts index 943176faf5c..c9f4c324964 100644 --- a/pkg/rancher-desktop/config/__tests__/commandLineOptions.spec.ts +++ b/pkg/rancher-desktop/config/__tests__/commandLineOptions.spec.ts @@ -134,7 +134,7 @@ describe('commandLineOptions', () => { '--application.updater.enabled', '--application.autoStart', '--application.startInBackground', - '--application.hideNotificationIcon', + '--application.hideNotivicationIcon', '--application.window.quitOnClose', '--containerEngine.allowedImages.enabled', ['--containerEngine.name', 'containerd'], diff --git a/pkg/rancher-desktop/config/settings.ts b/pkg/rancher-desktop/config/settings.ts index 7e9655f4160..e1c90fe0b5c 100644 --- a/pkg/rancher-desktop/config/settings.ts +++ b/pkg/rancher-desktop/config/settings.ts @@ -85,7 +85,7 @@ export const defaultSettings = { updater: { enabled: true }, autoStart: false, startInBackground: false, - hideNotificationIcon: false, + hideNotivicationIcon: false, window: { quitOnClose: false }, }, containerEngine: { @@ -480,7 +480,7 @@ const updateTable: Record void> = { } delete settings.virtualMachine.experimental; } - for (const field of ['autoStart', 'hideNotificationIcon', 'startInBackground', 'window']) { + for (const field of ['autoStart', 'hideNotivicationIcon', 'startInBackground', 'window']) { if (field in settings) { settings.application[field] = settings[field]; delete settings[field]; diff --git a/pkg/rancher-desktop/main/commandServer/settingsValidator.ts b/pkg/rancher-desktop/main/commandServer/settingsValidator.ts index d4441454553..18044f56109 100644 --- a/pkg/rancher-desktop/main/commandServer/settingsValidator.ts +++ b/pkg/rancher-desktop/main/commandServer/settingsValidator.ts @@ -90,7 +90,7 @@ export default class SettingsValidator { updater: { enabled: this.checkBoolean }, autoStart: this.checkBoolean, startInBackground: this.checkBoolean, - hideNotificationIcon: this.checkBoolean, + hideNotivicationIcon: this.checkBoolean, window: { quitOnClose: this.checkBoolean }, }, containerEngine: { From 43d7335ce2b2618291862f9b39dcf5c013b3b4c3 Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Wed, 28 Jun 2023 16:45:17 -0700 Subject: [PATCH 2/6] Test powershell case and typos. Signed-off-by: Eric Promislow --- scripts/windows/install-wsl.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/windows/install-wsl.ps1 b/scripts/windows/install-wsl.ps1 index 47208a651a0..25e03f26456 100644 --- a/scripts/windows/install-wsl.ps1 +++ b/scripts/windows/install-wsl.ps1 @@ -21,14 +21,14 @@ $sudoInstallScript = (Join-Path $scriptPath sudo-install-wsl.ps1) if ($Step -eq "EnableWSL-01") { Write-Output "Doing Step EnableWSL-01" - Write-Output "Doing Step EnableWSL-01" | Out-File $logFile + Write-Output "Doing Step EnableWSL-01" | Out-gile $logFile dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart Restart-Machine-With-Resume-Command $sudoInstallScript "EnableVMPlatform-02" "installation (step 2)" } if ($Step -eq "EnableVMPlatform-02") { Write-Output "Doing Step EnableVMPlatform-02" - Write-Output "Doing Step EnableVMPlatform-02" | Out-File -Append $logFile + Write-Output "Doing Step EnableVMPlatform-02" | out-file -Append $logFile dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart Restart-Machine-With-Resume-Command $sudoInstallScript "InstallLinuxUpdatePackage-03" "installation (step 3)" } From cd86a3a6a44bb5cc11729a8c7cb7499d70cac362 Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Wed, 28 Jun 2023 16:47:29 -0700 Subject: [PATCH 3/6] Undo the notification typo. Signed-off-by: Eric Promislow --- background.ts | 4 ++-- bats/tests/containers/auto-start.bats | 6 +++--- pkg/rancher-desktop/assets/specs/command-api.yaml | 2 +- .../components/Preferences/ApplicationBehavior.vue | 6 +++--- .../config/__tests__/commandLineOptions.spec.ts | 2 +- pkg/rancher-desktop/config/settings.ts | 4 ++-- pkg/rancher-desktop/main/commandServer/settingsValidator.ts | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/background.ts b/background.ts index 2368736344c..ee2a8e88090 100644 --- a/background.ts +++ b/background.ts @@ -132,7 +132,7 @@ mainEvents.on('settings-update', async(newSettings) => { } await pathManager.enforce(); - if (newSettings.application.hideNotivicationIcon) { + if (newSettings.application.hideNotificationIcon) { Tray.getInstance(cfg).hide(); } else { if (firstRunDialogComplete) { @@ -262,7 +262,7 @@ Electron.app.whenReady().then(async() => { iconPath: path.join(paths.resources, 'icons', 'logo-square-512.png'), }); - if (!cfg.application.hideNotivicationIcon) { + if (!cfg.application.hideNotificationIcon) { Tray.getInstance(cfg).show(); } diff --git a/bats/tests/containers/auto-start.bats b/bats/tests/containers/auto-start.bats index 8a44d6ef67a..9ee25798f60 100644 --- a/bats/tests/containers/auto-start.bats +++ b/bats/tests/containers/auto-start.bats @@ -18,7 +18,7 @@ load '../helpers/load' run get_setting '.application.window.quitOnClose' assert_success assert_output false - run get_setting '.application.hideNotivicationIcon' + run get_setting '.application.hideNotificationIcon' assert_success assert_output false } @@ -101,14 +101,14 @@ load '../helpers/load' @test 'Enable hide-notification-icon' { rdctl set --application.hide-notification-icon=true - run get_setting '.application.hideNotivicationIcon' + run get_setting '.application.hideNotificationIcon' assert_success assert_output true } @test 'Disable hide-notification-icon' { rdctl set --application.hide-notification-icon=false - run get_setting '.application.hideNotivicationIcon' + run get_setting '.application.hideNotificationIcon' assert_success assert_output false } diff --git a/pkg/rancher-desktop/assets/specs/command-api.yaml b/pkg/rancher-desktop/assets/specs/command-api.yaml index deb6be7402e..27b9b6ab01f 100644 --- a/pkg/rancher-desktop/assets/specs/command-api.yaml +++ b/pkg/rancher-desktop/assets/specs/command-api.yaml @@ -399,7 +399,7 @@ components: startInBackground: type: boolean x-rd-usage: start app without window - hideNotivicationIcon: + hideNotificationIcon: type: boolean x-rd-usage: don't show notification icon window: diff --git a/pkg/rancher-desktop/components/Preferences/ApplicationBehavior.vue b/pkg/rancher-desktop/components/Preferences/ApplicationBehavior.vue index 8bc5c063cd2..353f8e2ba39 100644 --- a/pkg/rancher-desktop/components/Preferences/ApplicationBehavior.vue +++ b/pkg/rancher-desktop/components/Preferences/ApplicationBehavior.vue @@ -65,9 +65,9 @@ export default Vue.extend({ > diff --git a/pkg/rancher-desktop/config/__tests__/commandLineOptions.spec.ts b/pkg/rancher-desktop/config/__tests__/commandLineOptions.spec.ts index c9f4c324964..943176faf5c 100644 --- a/pkg/rancher-desktop/config/__tests__/commandLineOptions.spec.ts +++ b/pkg/rancher-desktop/config/__tests__/commandLineOptions.spec.ts @@ -134,7 +134,7 @@ describe('commandLineOptions', () => { '--application.updater.enabled', '--application.autoStart', '--application.startInBackground', - '--application.hideNotivicationIcon', + '--application.hideNotificationIcon', '--application.window.quitOnClose', '--containerEngine.allowedImages.enabled', ['--containerEngine.name', 'containerd'], diff --git a/pkg/rancher-desktop/config/settings.ts b/pkg/rancher-desktop/config/settings.ts index e1c90fe0b5c..7e9655f4160 100644 --- a/pkg/rancher-desktop/config/settings.ts +++ b/pkg/rancher-desktop/config/settings.ts @@ -85,7 +85,7 @@ export const defaultSettings = { updater: { enabled: true }, autoStart: false, startInBackground: false, - hideNotivicationIcon: false, + hideNotificationIcon: false, window: { quitOnClose: false }, }, containerEngine: { @@ -480,7 +480,7 @@ const updateTable: Record void> = { } delete settings.virtualMachine.experimental; } - for (const field of ['autoStart', 'hideNotivicationIcon', 'startInBackground', 'window']) { + for (const field of ['autoStart', 'hideNotificationIcon', 'startInBackground', 'window']) { if (field in settings) { settings.application[field] = settings[field]; delete settings[field]; diff --git a/pkg/rancher-desktop/main/commandServer/settingsValidator.ts b/pkg/rancher-desktop/main/commandServer/settingsValidator.ts index 18044f56109..d4441454553 100644 --- a/pkg/rancher-desktop/main/commandServer/settingsValidator.ts +++ b/pkg/rancher-desktop/main/commandServer/settingsValidator.ts @@ -90,7 +90,7 @@ export default class SettingsValidator { updater: { enabled: this.checkBoolean }, autoStart: this.checkBoolean, startInBackground: this.checkBoolean, - hideNotivicationIcon: this.checkBoolean, + hideNotificationIcon: this.checkBoolean, window: { quitOnClose: this.checkBoolean }, }, containerEngine: { From c87520f3d9b490fb8fa362a05dc311c0d134f513 Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Wed, 28 Jun 2023 17:00:01 -0700 Subject: [PATCH 4/6] More deliberate typos. Signed-off-by: Eric Promislow --- pkg/rancher-desktop/utils/logging.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/rancher-desktop/utils/logging.ts b/pkg/rancher-desktop/utils/logging.ts index 52e9c6bf2b5..c3ef1b1397b 100644 --- a/pkg/rancher-desktop/utils/logging.ts +++ b/pkg/rancher-desktop/utils/logging.ts @@ -185,3 +185,11 @@ export function clearLoggingDirectory(): void { } fs.mkdirSync(paths.logs, { recursive: true }); + +// This is supposed to be ok for the pattern-matcher +type Github = string; + +// This shouldn't be +const blah: Github = 'complain to Github'; + +console.log(blah); From 5ac57a5ec27870e77cc0fb05c391b09e89a21d31 Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Wed, 28 Jun 2023 17:02:28 -0700 Subject: [PATCH 5/6] More typos. Signed-off-by: Eric Promislow --- pkg/rancher-desktop/utils/logging.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/rancher-desktop/utils/logging.ts b/pkg/rancher-desktop/utils/logging.ts index c3ef1b1397b..a3819275130 100644 --- a/pkg/rancher-desktop/utils/logging.ts +++ b/pkg/rancher-desktop/utils/logging.ts @@ -193,3 +193,10 @@ type Github = string; const blah: Github = 'complain to Github'; console.log(blah); + +// Is this caught? +// We're doing a type Github test +// And this? +// We're doing a Github test +// How about this: +// blahtype Github From 6b1d096ffd9f09405640c762608bc02d95562586 Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Wed, 28 Jun 2023 17:08:52 -0700 Subject: [PATCH 6/6] More github case experiments. Signed-off-by: Eric Promislow --- .github/actions/spelling/README.md | 1 + pkg/rancher-desktop/utils/logging.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/actions/spelling/README.md b/.github/actions/spelling/README.md index 1f699f3de3d..b3262749f67 100644 --- a/.github/actions/spelling/README.md +++ b/.github/actions/spelling/README.md @@ -1,6 +1,7 @@ # check-spelling/check-spelling configuration File | Purpose | Format | Info +---- | ------- | ------ | ---- -|-|-|- [dictionary.txt](dictionary.txt) | Replacement dictionary (creating this file will override the default dictionary) | one word per line | [dictionary](https://github.com/check-spelling/check-spelling/wiki/Configuration#dictionary) [allow.txt](allow.txt) | Add words to the dictionary | one word per line (only letters and `'`s allowed) | [allow](https://github.com/check-spelling/check-spelling/wiki/Configuration#allow) diff --git a/pkg/rancher-desktop/utils/logging.ts b/pkg/rancher-desktop/utils/logging.ts index a3819275130..147d771afb5 100644 --- a/pkg/rancher-desktop/utils/logging.ts +++ b/pkg/rancher-desktop/utils/logging.ts @@ -190,13 +190,13 @@ fs.mkdirSync(paths.logs, { recursive: true }); type Github = string; // This shouldn't be -const blah: Github = 'complain to Github'; +const blah: Github = 'complain to GitHub (fixed)'; console.log(blah); // Is this caught? // We're doing a type Github test // And this? -// We're doing a Github test -// How about this: -// blahtype Github +// We're doing a GitHub (fixed) test +// This should be flagged: +// prototype Github