From 3cb0638c7eb9264074cd8d3e8eefac8cafa527f1 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Fri, 1 Jul 2022 10:09:41 -0400 Subject: [PATCH] [ci]Upgrade to check-spelling 0.0.20alpha7 (#19127) * spelling: added Signed-off-by: Josh Soref * spelling: and Signed-off-by: Josh Soref * spelling: another Signed-off-by: Josh Soref * spelling: color Signed-off-by: Josh Soref * spelling: file Signed-off-by: Josh Soref * spelling: github Signed-off-by: Josh Soref * spelling: not Signed-off-by: Josh Soref * spelling: occurrences Signed-off-by: Josh Soref * spelling: stamp Signed-off-by: Josh Soref * spelling: suppressions Signed-off-by: Josh Soref * spelling: the Signed-off-by: Josh Soref * spelling: up to Signed-off-by: Josh Soref * spelling: whether Signed-off-by: Josh Soref * spelling: whichdoes Signed-off-by: Josh Soref * Upgrade check-spelling to v0.0.20-alpha7 Config based on: https://github.com/check-spelling/spell-check-this/tree/a5001170a754da309ca324ce7eed8a076af2f4ac * Adding duplicate detection to patterns.txt * Adding line_forbidden.patterns * Adding reject.txt * Updated excludes (and sorted) * Switching to unified workflow * moving `wil` to allow.txt to clarify that it's a term of art (https://github.com/microsoft/wil), whereas often it's a typo for `will`. * Update src/runner/main.cpp Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- .github/actions/spell-check/README.md | 15 ++++++ .github/actions/spell-check/allow.txt | 1 + .github/actions/spell-check/excludes.txt | 44 +++++++++++++----- .github/actions/spell-check/expect.txt | 43 +++++------------ .../spell-check/line_forbidden.patterns | 32 +++++++++++++ .github/actions/spell-check/patterns.txt | 13 +++++- .github/actions/spell-check/reject.txt | 10 ++++ .github/workflows/spelling2.yml | 46 ++++++------------- Directory.Build.props | 2 +- .../keyboardmanager/keyboardeventhandlers.md | 2 +- .../keyboardmanager/keyboardmanager.md | 8 ++-- .../keyboardmanager/keyboardmanagerui.md | 2 +- .../launcher/plugins/windowssettings.md | 2 +- .../PowerToysSetup/PowerToysInstaller.wixproj | 2 +- src/codeAnalysis/GlobalSuppressions.cs | 2 +- .../ColorPickerUI/NativeMethods.cs | 2 +- .../ShortcutControl.cpp | 4 +- .../SingleKeyRemapControl.cpp | 2 +- .../AppSpecificShortcutRemappingTests.cpp | 4 +- .../Programs/Win32Tests.cs | 2 +- .../Storage/EventHandler.cs | 2 +- .../Components/WindowProcess.cs | 2 +- .../Properties/Resources.Designer.cs | 2 +- .../Classes/WindowsSetting.cs | 4 +- .../PowerLauncher/Helper/EnvironmentHelper.cs | 4 +- .../Properties/Settings.Designer.cs | 4 +- .../Properties/Settings.settings | 2 +- .../VirtualDesktop/VirtualDesktopHelper.cs | 6 +-- .../PowerRenameUILib/MainWindow.xaml.cpp | 10 ++-- .../powerrename/lib/PowerRenameInterfaces.h | 2 +- .../powerrename/lib/PowerRenameRegEx.cpp | 6 +-- .../unittests/PowerRenameRegExBoostTests.cpp | 18 ++++---- .../unittests/PowerRenameRegExTests.cpp | 24 +++++----- .../common/controls/FormHandlerControl.cs | 2 +- src/runner/main.cpp | 2 +- .../ColorPickerActivationAction.cs | 2 +- .../Settings.UI/GlobalSuppressions.cs | 4 +- 37 files changed, 190 insertions(+), 144 deletions(-) create mode 100644 .github/actions/spell-check/README.md create mode 100644 .github/actions/spell-check/allow.txt create mode 100644 .github/actions/spell-check/line_forbidden.patterns create mode 100644 .github/actions/spell-check/reject.txt diff --git a/.github/actions/spell-check/README.md b/.github/actions/spell-check/README.md new file mode 100644 index 0000000000..ca5ca67d08 --- /dev/null +++ b/.github/actions/spell-check/README.md @@ -0,0 +1,15 @@ +# check-spelling/check-spelling configuration + +File | Purpose | Format | Info +-|-|-|- +[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) +[reject.txt](reject.txt) | Remove words from the dictionary (after allow) | grep pattern matching whole dictionary words | [reject](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-reject) +[excludes.txt](excludes.txt) | Files to ignore entirely | perl regular expression | [excludes](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-excludes) +[only.txt](only.txt) | Only check matching files (applied after excludes) | perl regular expression | [only](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-only) +[patterns.txt](patterns.txt) | Patterns to ignore from checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns) +[line_forbidden.patterns](line_forbidden.patterns) | Patterns to flag in checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns) +[expect.txt](expect.txt) | Expected words that aren't in the dictionary | one word per line (sorted, alphabetically) | [expect](https://github.com/check-spelling/check-spelling/wiki/Configuration#expect) +[advice.md](advice.md) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice) + +Note: you can replace any of these files with a directory by the same name (minus the suffix) +and then include multiple files inside that directory (with that suffix) to merge multiple files together. diff --git a/.github/actions/spell-check/allow.txt b/.github/actions/spell-check/allow.txt new file mode 100644 index 0000000000..1e52743983 --- /dev/null +++ b/.github/actions/spell-check/allow.txt @@ -0,0 +1 @@ +wil diff --git a/.github/actions/spell-check/excludes.txt b/.github/actions/spell-check/excludes.txt index bc08eed6e4..c6be09996b 100644 --- a/.github/actions/spell-check/excludes.txt +++ b/.github/actions/spell-check/excludes.txt @@ -1,13 +1,15 @@ # See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes -(?:^|/)monacoSRC/ -(?:^|/)MonacoPreviewHandler/customLanguages/ -(?:^|/)MonacoPreviewHandler/monaco_languages.json -(?:^|/)MonacoPreviewHandler/index.html -(?:^|/)MonacoPreviewHandler/generateLanguagesJson.html -(?:^|/)MonacoPreviewHandler/monacoSpecialLanguages.js (?:^|/)(?i)COPYRIGHT (?:^|/)(?i)LICEN[CS]E -(?:^|/)package(?:-lock)\.json$ +(?:^|/)go\.sum$ +(?:^|/)MonacoPreviewHandler/customLanguages/ +(?:^|/)MonacoPreviewHandler/generateLanguagesJson.html +(?:^|/)MonacoPreviewHandler/index.html +(?:^|/)MonacoPreviewHandler/monacoSpecialLanguages.js +(?:^|/)MonacoPreviewHandler/monaco_languages.json +(?:^|/)monacoSRC/ +(?:^|/)package(?:-lock|)\.json$ +(?:^|/)timezones\.json$ (?:^|/)vendor/ (?:^|/)WindowsSettings\.json$ /package(?:-lock|)\.json$ @@ -16,24 +18,44 @@ ignore$ [/.][a-z]{2}(?:-[a-zA-Z]{2}|)\. \.ai$ +\.avi$ \.bmp$ +\.bz2$ +\.crt$ \.dat$ \.dll$ +\.DS_Store$ +\.eot$ \.filters$ \.gcode$ \.gif$ +\.gitattributes$ \.gitignore$ +\.graffle$ +\.gz$ +\.icns$ \.ico$ -\.jpg$ +\.jar$ +\.jpe?g$ +\.key$ \.lcl$ \.lock$ -\.min\. +\.map$ +\.min\.. \.mod$ +\.mp[34]$ +\.ocf$ +\.otf$ \.pdf$ +\.pem$ \.PNG$ \.png$ +\.psd$ \.stl$ -\.woff$ +\.svg$ +\.ttf$ +\.wav$ +\.woff2?$ \.zip$ ^doc/devdocs/akaLinks\.md$ ^installer/PowerToysSetup/WebView2/MicrosoftEdgeWebview2Setup.exe$ @@ -52,6 +74,4 @@ ignore$ ^\.github/ ^\.github/actions/spell-check/ ^\.gitmodules$ -(?:^|/)WindowsSettings\.json$ -(?:^|/)timezones\.json$ ^\Q.pipelines/ESRPSigning_core.json\E$ diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 068c343369..cedc2cb1f2 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -20,6 +20,7 @@ actioned activatable ACTIVATEAPP activationaction +adamchilders ADDUNDORECORD ADifferent ADMINS @@ -94,7 +95,6 @@ ARPPRODUCTICON ARRAYSIZE arsinh artanh -Artboard Artsakh asdf AShortcut @@ -133,6 +133,7 @@ awakeness awakeversion AWAYMODE AYUV +azchohfi backend backtracer BADD @@ -190,7 +191,6 @@ Bto buf BUFSIZE bugreport -BUILDARCH BUILDNUMBER buildtask buildtransitive @@ -268,7 +268,6 @@ cnt Cocklebiddy coclass codebase -codecvt CODENAME codeofconduct codereview @@ -299,7 +298,6 @@ comsuppw comsuppwd comutil Concat -concrt configs Configurator CONFLICTINGMODIFIERKEY @@ -337,6 +335,7 @@ crlf cron Crossdevice CRSEL +crutkas CSearch CSettings csharp @@ -439,11 +438,9 @@ devblogs devdocs devenum DEVMON -devops devpkey DEVSOURCE dhcp -diffing difftime DIIRFLAG dimm @@ -460,7 +457,6 @@ DLGMODALFRAME dlib dllexport dllhost -dllimport dllmain dlls DNLEN @@ -494,9 +490,9 @@ DWINRT dwl dwm dwmapi -dwmcorei DWMCOLORIZATIONCOLORCHANGED DWMCOMPOSITIONCHANGED +dwmcorei DWMNCRENDERINGCHANGED Dwmp DWMSENDICONICLIVEPREVIEWBITMAP @@ -524,6 +520,7 @@ EFile ekus elif elseif +eltociear Emoji emptyrecyclebin ENABLEDPOPUP @@ -538,7 +535,7 @@ entrypoint ENU enum EOAC -eol +EOL epicgames Eqn ERASEBKGND @@ -683,6 +680,7 @@ hanselman hardcoded Hardlines HARDWAREINPUT +harvastum hashcode Hashset Hashtable @@ -743,7 +741,6 @@ homljgmgpmcbpjbnjpfijnhipfkiclkd HOOKPROC Hostbackdropbrush hostname -hotfix hotkeycontrol hotkeys hotlight @@ -867,7 +864,6 @@ IMedia IMem IMessage imeutil -iminstall IMoniker IMouse impl @@ -985,7 +981,6 @@ IVector IView IVirtual IWbem -IWeb IWIC iwindow IWork @@ -1079,7 +1074,6 @@ LIBID Lifecycle LIGHTORANGE LIGHTTURQUOISE -lightunplated lindex linkedin linq @@ -1288,7 +1282,6 @@ msp msrc mst msvc -msvcp MTND Mul multiline @@ -1424,7 +1417,6 @@ Objbase OBJID objidl oblitum -octodex odbc odbccp Oem @@ -1459,7 +1451,6 @@ OSVERSIONINFOEX OSVERSIONINFOEXW OSVERSIONINFOW osvi -otating OUTOFCONTEXT OUTOFMEMORY outpin @@ -1498,7 +1489,6 @@ PCIDLIST PCWSTR pdb pdbonly -pde pdfpreviewhandler pdo pdto @@ -1653,6 +1643,7 @@ RBUTTONDBLCLK RBUTTONDOWN RBUTTONUP rclsid +rcmaehl RCONTROL RCtrl readme @@ -1752,8 +1743,6 @@ RTB RTCS RTLREADING RTSS -ruleset -RUNACTIVEXCTLS runas rundll rungameid @@ -1816,6 +1805,7 @@ SETWORKAREA sfgao SFGAOF SFP +shandsj sharpkeys SHCNE SHCNF @@ -1864,6 +1854,7 @@ SIGABRT sigdn SIGNINGSCENARIO signtool +sinclairinat SINGLEKEY singlekeyremapcontrol singletones @@ -1877,7 +1868,6 @@ SIZENWSE sizeof sizeread SIZEWE -sketchapp SKIPOWNPROCESS sku SLGP @@ -1885,6 +1875,7 @@ sln SMALLICON SMTO snd +snickler snwprintf softline somil @@ -1982,7 +1973,6 @@ subquery substr Sul Superbar -supressions Suri sut SVE @@ -2054,7 +2044,6 @@ THH THICKFRAME THISCOMPONENT THotkey -thre TILEDWINDOW timedate timediff @@ -2091,7 +2080,6 @@ TRK trl trunc Tshuapa -tspan TStr Tuva TValue @@ -2184,14 +2172,10 @@ uxtheme UYVY validmodulename vcamp -vccorlib vcdl VCINSTALLDIR vcm -vcomp -vcredist VCRT -vcruntime vcvars VDesktop vdi @@ -2262,13 +2246,11 @@ wekyb Wevtapi wformat wgpocpl -Whichdoes whitespaces WIC wifi wiki wikipedia -wil wildcards winapi winappdriver @@ -2277,7 +2259,6 @@ Wincodecsdk wincolor windef windir -Windowcontrols WINDOWCREATED WINDOWEDGE WINDOWNAME @@ -2285,8 +2266,6 @@ WINDOWPLACEMENT WINDOWPOSCHANGED WINDOWPOSCHANGING Windowsapp -windowsappruntimeinstall -windowsappsdk WINDOWSBUILDNUMBER Windowscodecs windowsdesktop diff --git a/.github/actions/spell-check/line_forbidden.patterns b/.github/actions/spell-check/line_forbidden.patterns new file mode 100644 index 0000000000..cd42ca310f --- /dev/null +++ b/.github/actions/spell-check/line_forbidden.patterns @@ -0,0 +1,32 @@ +# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere +# \bm_data\b + +# s.b. GitHub +\bGithub\b + +# s.b. GitLab +\bGitlab\b + +# s.b. JavaScript +\bJavascript\b + +# s.b. Microsoft +\bMicroSoft\b + +# s.b. another +\ban other\b + +# s.b. otherwise +\bother wise\b + +# s.b. nonexistent +\bnon existing\b + +# s.b. preexisting +[Pp]re-existing + +# s.b. preemptively +[Pp]re-emptively + +# Reject duplicate words +\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s diff --git a/.github/actions/spell-check/patterns.txt b/.github/actions/spell-check/patterns.txt index 68b06a098d..8d93f27f5d 100644 --- a/.github/actions/spell-check/patterns.txt +++ b/.github/actions/spell-check/patterns.txt @@ -43,8 +43,6 @@ Hash="[0-9A-F]{40}" # hex digits including css/html color classes: (?:[\\0][xX]|\\u|[uU]\+|#x?|\%23|L")[0-9a-fA-FgGrR_]{2,}(?:[uU]?[lL]{0,2}|u\d+)\b -# ignore long runs of a single character: -\b([A-Za-z])\g{-1}{3,}\b (?:L"[abAB]+", ){3}L"[abAB]+" "Lorem[^"]+?\." TestCase\("[^"]+" @@ -105,3 +103,14 @@ http://tes/ # tar arguments \b(?:\\n|)tar(?:\s+-[a-zA-Z]+|\s[a-z]+)+ + +# acceptable duplicates +# /bin/ls -l output +[-bcdlpsw](?:[-r][-w][-sx]){3}\s+\d+\s+(\S+)\s+\g{-1}\s+\d+\s+ +# C types +\s(long|LONG) \g{-1}\s +# javadoc / .net +(?:\@(?:groupname|param)|(?:public|private)(?:\s+static|\s+readonly)*)\s+(\w+)\s+\g{-1}\s + +# ignore long runs of a single character: +\b([A-Za-z])\g{-1}{3,}\b diff --git a/.github/actions/spell-check/reject.txt b/.github/actions/spell-check/reject.txt new file mode 100644 index 0000000000..b5a6d36809 --- /dev/null +++ b/.github/actions/spell-check/reject.txt @@ -0,0 +1,10 @@ +^attache$ +benefitting +occurences? +^dependan.* +^oer$ +Sorce +^[Ss]pae.* +^untill$ +^untilling$ +^wether.* diff --git a/.github/workflows/spelling2.yml b/.github/workflows/spelling2.yml index 350b7d0d01..f23b3bdc42 100644 --- a/.github/workflows/spelling2.yml +++ b/.github/workflows/spelling2.yml @@ -12,8 +12,9 @@ jobs: permissions: contents: read pull-requests: read + actions: read outputs: - internal_state_directory: ${{ steps.spelling.outputs.internal_state_directory }} + followup: ${{ steps.spelling.outputs.followup }} runs-on: ubuntu-latest if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'" concurrency: @@ -21,35 +22,19 @@ jobs: # note: If you use only_check_changed_files, you do not want cancel-in-progress cancel-in-progress: true steps: - - name: checkout-merge - if: "contains(github.event_name, 'pull_request')" - uses: actions/checkout@v2 - with: - ref: refs/pull/${{github.event.pull_request.number}}/merge - - name: checkout - if: github.event_name == 'push' - uses: actions/checkout@v2 - name: check-spelling id: spelling - uses: check-spelling/check-spelling@v0.0.20-alpha3 + uses: check-spelling/check-spelling@v0.0.20-alpha7 with: config: .github/actions/spell-check suppress_push_for_open_pull_request: 1 + checkout: true post_comment: 0 - dictionary_source_prefixes: '{"cspell": "https://raw.githubusercontent.com/check-spelling/cspell-dicts/master/dictionaries/"}' extra_dictionaries: cspell:filetypes/filetypes.txt cspell:html/html.txt cspell:css/css.txt check_extra_dictionaries: '' - - name: store-comment - if: failure() - uses: actions/upload-artifact@v2 - with: - retention-days: 1 - name: "check-spelling-comment-${{ github.run_id }}" - path: | - ${{ steps.spelling.outputs.internal_state_directory }} comment: name: Comment @@ -58,21 +43,16 @@ jobs: permissions: contents: write pull-requests: write - if: always() && needs.spelling.result == 'failure' && needs.spelling.outputs.internal_state_directory + if: (success() || failure()) && needs.spelling.outputs.followup steps: - - name: checkout - uses: actions/checkout@v2 - - name: set up - run: | - mkdir /tmp/data - - name: retrieve-comment - uses: actions/download-artifact@v2 - with: - name: "check-spelling-comment-${{ github.run_id }}" - path: /tmp/data - name: comment - uses: check-spelling/check-spelling@v0.0.20-alpha3 + uses: check-spelling/check-spelling@v0.0.20-alpha7 with: config: .github/actions/spell-check - custom_task: comment - internal_state_directory: /tmp/data + checkout: true + task: ${{ needs.spelling.outputs.followup }} + extra_dictionaries: + cspell:filetypes/filetypes.txt + cspell:html/html.txt + cspell:css/css.txt + check_extra_dictionaries: '' diff --git a/Directory.Build.props b/Directory.Build.props index 7ba77528b1..36b6acd81b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -16,7 +16,7 @@ https://github.com/microsoft/PowerToys - Github + GitHub diff --git a/doc/devdocs/modules/keyboardmanager/keyboardeventhandlers.md b/doc/devdocs/modules/keyboardmanager/keyboardeventhandlers.md index e6bfc0bbfa..1732694dcb 100644 --- a/doc/devdocs/modules/keyboardmanager/keyboardeventhandlers.md +++ b/doc/devdocs/modules/keyboardmanager/keyboardeventhandlers.md @@ -23,7 +23,7 @@ This file contains documentation for all the methods involved in key/shortcut re ## HandleShortcutRemapEvent [This method](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/KeyboardEventHandlers.cpp#L178-L739) is used for handling the shortcut to shortcut and shortcut to key remapping logic. The general logic is as follows: - Check if any shortcut remap is currently invoked. This is required to ensure that two remaps don't occur simultaneously at a time, and we send key up events for the shortcuts only if they are actually invoked and not for artificial key up events. In addition to that, while a remap is in the middle of execution, the keyboard state will not match the physical keys, so we do not want a remap Ctrl+A to Ctrl+V to also trigger the remap from Ctrl+V to Alt+V on pressing Ctrl+A on the keyboard. -- Get the remap table as per the the `activatedApp` argument (i.e. if it is empty, we get the global shortcut remap table and otherwise we get the corresponding app-specific shortcut remap table). +- Get the remap table as per the `activatedApp` argument (i.e. if it is empty, we get the global shortcut remap table and otherwise we get the corresponding app-specific shortcut remap table). - Iterate over the list of remaps in descending order of number of keys in the shortcut. This is required **for shortcut to key remaps** to ensure that if a user has both Ctrl+A and Ctrl+Shift+A remapped to some keys, and the user presses Ctrl+Shift+A, then we prefer the Ctrl+Shift+A remap. This logic would not be required if there were only shortcut to shortcut remaps, as they are invoked only on exact match. - If any shortcut was found to be invoked (from the first step), then we skip till we find the matching shortcut remap. If not we check if the modifiers of the original shortcut are pressed down. If they are, we check if the current key event is a key down event and it matches the action key of the original shortcut. For shortcut to shortcut and for disabling a shortcut [we have an additional step](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/KeyboardEventHandlers.cpp#L208-L212) where we check if any other key is pressed apart from the original shortcut. This is required because for these two features we allow the remaps only if those exact keys are pressed. The method used for this is described in detail [here](keyboardmanagercommon.md#IsKeyboardStateClearExceptShortcut). If a win key was pressed, we store whether it was the left or the right one, in order to determine which key to set for remaps from/to the common Win key code which we added. This is so that pressing and releasing Left Win key results in that Win key getting modified and not the Right Win key. - If the remap is to a key, we send a dummy key event followed by releasing the original shortcut's modifiers and setting the target key (or doing nothing if it is remapped to disable) and we suppress the event. diff --git a/doc/devdocs/modules/keyboardmanager/keyboardmanager.md b/doc/devdocs/modules/keyboardmanager/keyboardmanager.md index e63213ea2a..030e0ad5df 100644 --- a/doc/devdocs/modules/keyboardmanager/keyboardmanager.md +++ b/doc/devdocs/modules/keyboardmanager/keyboardmanager.md @@ -101,7 +101,7 @@ KBM uses two sets of settings files. - `remapShortcuts` is split into `global` and `appSpecific`, where `global` remaps would apply to all applications, whereas `appSpecific` would apply on when the `targetApp` is in focus. `targetApp` must be the process name of the app (with or without it's extension), e.g. `msedge` or `msedge.exe` for Microsoft Edge. ## Loading settings -KBM settings are loaded only on the C++ side only at start up, in the [constructor](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L67-L68). The settings file may get modified from the KBM UI on applying new remappings, but the the file is not read again. The files are read from the PowerToys Settings process whenever a change is made to the file (using a FileWatcher) or whenever the KBM page is opened. The settings are updated only when the user presses the OK button from either of the Remap Keys or Remap Shortcuts windows. This is described in more detail [here](keyboardmanagerui.md#ok-and-cancel-button). +KBM settings are loaded only on the C++ side only at start up, in the [constructor](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L67-L68). The settings file may get modified from the KBM UI on applying new remappings, but the file is not read again. The files are read from the PowerToys Settings process whenever a change is made to the file (using a FileWatcher) or whenever the KBM page is opened. The settings are updated only when the user presses the OK button from either of the Remap Keys or Remap Shortcuts windows. This is described in more detail [here](keyboardmanagerui.md#ok-and-cancel-button). ## Low level keyboard hook handler Since the [`hook_proc`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L330-L349) cannot be a member function in the class, this is declared `static` and a `static pointer` to the `KeyboardManager` project is used ([`keyboardmanager_object_ptr`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L54-L55)). @@ -114,10 +114,10 @@ As seen in the code for `hook_proc`, similar to other keyboard hooks in PowerToy The [`HandleKeyboardHookEvent`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L384-L458) is the method which calls the corresponding remapping methods in the required order. The following checks are executed in order: - **`KeyboardManagerState.AreRemappingsEnabled`:** This returns false while the KBM remap tables are getting updated. If it is in this state, `HandleKeyboardHookEvent` returns `0`, i.e. the key event is not suppressed and is forwarded normally. - **Check for `KEYBOARDMANAGER_SUPPRESS_FLAG`:** If the key event has the suppress flag, the method returns 1 to suppress the key event. -- **[`KeyboardManagerState.DetectSingleRemapKeyUIBackend`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L399-L408):** This method is used for handling hook operations for the single key Type UI in the Remap keys window. If the Remap keys window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the left column Type button is clicked on the Remap keys window and and the window is in focus, then the key event is suppressed and the UI is updated with the latest key from the recent key events. This method is described in more detail [here](keyboardmanagercommon.md#DetectSingleRemapKeyUIBackend-and-DetectShortcutUIBackend). -- **[`KeyboardManagerState.DetectShortcutUIBackend(data, true)`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L410-L419):** This method is used for handling hook operations for the shortcut Type UI in the Remap keys window (when `isRemapKey` arg is `true`). If the Remap keys window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the right column Type button is clicked on the Remap keys window and and the window is in focus, then the key event is suppressed and the UI is updated with the shortcut from the recent key events. This method is described in more detail [here](keyboardmanagercommon.md#DetectSingleRemapKeyUIBackend-and-DetectShortcutUIBackend). +- **[`KeyboardManagerState.DetectSingleRemapKeyUIBackend`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L399-L408):** This method is used for handling hook operations for the single key Type UI in the Remap keys window. If the Remap keys window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the left column Type button is clicked on the Remap keys window and the window is in focus, then the key event is suppressed and the UI is updated with the latest key from the recent key events. This method is described in more detail [here](keyboardmanagercommon.md#DetectSingleRemapKeyUIBackend-and-DetectShortcutUIBackend). +- **[`KeyboardManagerState.DetectShortcutUIBackend(data, true)`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L410-L419):** This method is used for handling hook operations for the shortcut Type UI in the Remap keys window (when `isRemapKey` arg is `true`). If the Remap keys window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the right column Type button is clicked on the Remap keys window and the window is in focus, then the key event is suppressed and the UI is updated with the shortcut from the recent key events. This method is described in more detail [here](keyboardmanagercommon.md#DetectSingleRemapKeyUIBackend-and-DetectShortcutUIBackend). - **`HandleSingleKeyRemapEvent`:** This method handles the single key remap logic. If a remapping takes place, the key event is suppressed. This method is described in more detail [here](keyboardeventhandlers.md#HandleSingleKeyRemapEvent). -- **[`KeyboardManagerState.DetectShortcutUIBackend(data, false)`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L430-L439):** This method is used for handling hook operations for the shortcut Type UI in the Remap shortcuts window (when `isRemapKey` arg is `false`). If the Remap shortcuts window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the Type button is clicked on the Remap shortcuts window and and the window is in focus, then the key event is suppressed and the UI is updated with the shortcut from the recent key events. **Since this is executed after the single key remap method, all single key remappings are applied when the user is on the Remap shortcuts window.** +- **[`KeyboardManagerState.DetectShortcutUIBackend(data, false)`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L430-L439):** This method is used for handling hook operations for the shortcut Type UI in the Remap shortcuts window (when `isRemapKey` arg is `false`). If the Remap shortcuts window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the Type button is clicked on the Remap shortcuts window and the window is in focus, then the key event is suppressed and the UI is updated with the shortcut from the recent key events. **Since this is executed after the single key remap method, all single key remappings are applied when the user is on the Remap shortcuts window.** - **`HandleAppSpecificShortcutRemapEvent`:** This method handles the app-specific shortcut remap logic. If a remapping takes place, the key event is suppressed. This method is described in more detail [here](keyboardeventhandlers.md#HandleAppSpecificShortcutRemapEvent). **Since this is executed after the single key remap method, single key remappings have precedence over shortcut remaps and are correspondingly reflected in shortcut remaps.** - **`HandleOSLevelShortcutRemapEvent`:** This method handles the global shortcut remap logic. If a remapping takes place, the key event is suppressed. This method is described in more detail [here](keyboardeventhandlers.md#HandleOSLevelShortcutRemapEvent). The app-specific remap method is executed before this because if a shortcut is remapped to different keys/shortcuts for a particular app and globally, the app-specific variant should be preferred if that app is in focus. **Since this is executed after the single key remap method, single key remappings have precedence over shortcut remaps and are correspondingly reflected in shortcut remaps.** diff --git a/doc/devdocs/modules/keyboardmanager/keyboardmanagerui.md b/doc/devdocs/modules/keyboardmanager/keyboardmanagerui.md index a6a9f42365..bcd68f5d16 100644 --- a/doc/devdocs/modules/keyboardmanager/keyboardmanagerui.md +++ b/doc/devdocs/modules/keyboardmanager/keyboardmanagerui.md @@ -105,7 +105,7 @@ Once this second level of validation is done, we proceed with [updating the buff Unlike the Single Key handler, there is a different set of errors that can occur here which are related to making a selection that is considered as a valid shortcut. The `isHybridControl` argument is used to distinguish between the differing behaviors for the two types of columns (shortcut only or shortcut/key column). The errors that can occur for this handler are: - Shortcut must start with modifier (selecting A on the first drop for the left column is invalid) - Shortcut can't have a repeated modifier (Ctrl+Ctrl(left)+A is not a shortcut) -- Shortcut can only have upto 2 modifiers (Ctrl+Shift+Alt is not supported as we have enforced a 3 key constraint (**not a backend limitation, there is [an issue](https://github.com/microsoft/PowerToys/issues/3936) requesting to remove this**)) +- Shortcut can only have up to 2 modifiers (Ctrl+Shift+Alt is not supported as we have enforced a 3 key constraint (**not a backend limitation, there is [an issue](https://github.com/microsoft/PowerToys/issues/3936) requesting to remove this**)) - Shortcut must contain an action key (Ctrl+A and change A to None, only for left column) - Shortcut must have at least two keys (Ctrl+A and change Ctrl to None, only for left column) - Disable can't be a modifier or action key (Ctrl+Disable is invalid) diff --git a/doc/devdocs/modules/launcher/plugins/windowssettings.md b/doc/devdocs/modules/launcher/plugins/windowssettings.md index a6eafb396c..b322b502af 100644 --- a/doc/devdocs/modules/launcher/plugins/windowssettings.md +++ b/doc/devdocs/modules/launcher/plugins/windowssettings.md @@ -61,7 +61,7 @@ A full entry for the `WindowsSettings.json` looks like: * The integer value for `IntroducedInBuild` and `DeprecatedInBuild` must be in range of `0` to `4294967295` * The strings for `Name`, `AltNames`, `Areas`, `Type` and `Note` must not contain whitespace(s) or special characters (#, €, $, etc.) * The strings for `Name`, `AltNames`, `Areas`, `Type` and `Note` are used as ids for the resource file under `Properties\Resources.resx` -* When you add new strings make sure you have add add all translations for it. +* When you add new strings make sure you have added all translations for it. ## Scores diff --git a/installer/PowerToysSetup/PowerToysInstaller.wixproj b/installer/PowerToysSetup/PowerToysInstaller.wixproj index 1e387d8d02..f091ec1ce3 100644 --- a/installer/PowerToysSetup/PowerToysInstaller.wixproj +++ b/installer/PowerToysSetup/PowerToysInstaller.wixproj @@ -48,7 +48,7 @@ call "..\..\publish.cmd" arm64 - + -v -sh -sw1108 diff --git a/src/codeAnalysis/GlobalSuppressions.cs b/src/codeAnalysis/GlobalSuppressions.cs index 59689cd603..ac92f3a0d4 100644 --- a/src/codeAnalysis/GlobalSuppressions.cs +++ b/src/codeAnalysis/GlobalSuppressions.cs @@ -54,4 +54,4 @@ using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Microsoft.Performance", "CA1812: Avoid uninstantiated internal classes", Scope = "module", Justification = "CA1812 will be thrown for every file in the test project. This is mentioned here: dotnet/roslyn-analyzers#1830")] // Code quality -[assembly: SuppressMessage("CodeQuality", "IDE0076:Invalid global 'SuppressMessageAttribute'", Justification = "Affect predefined supressions.")] +[assembly: SuppressMessage("CodeQuality", "IDE0076:Invalid global 'SuppressMessageAttribute'", Justification = "Affect predefined suppressions.")] diff --git a/src/modules/colorPicker/ColorPickerUI/NativeMethods.cs b/src/modules/colorPicker/ColorPickerUI/NativeMethods.cs index 3b24508d30..0288dfa2a0 100644 --- a/src/modules/colorPicker/ColorPickerUI/NativeMethods.cs +++ b/src/modules/colorPicker/ColorPickerUI/NativeMethods.cs @@ -187,7 +187,7 @@ namespace ColorPicker public int Flags; /// - /// The time stamp stamp for this message, equivalent to what GetMessageTime would return for this message. + /// The time stamp for this message, equivalent to what GetMessageTime would return for this message. /// public int TimeStamp; diff --git a/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/ShortcutControl.cpp b/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/ShortcutControl.cpp index a257b84c8b..baaaafc52a 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/ShortcutControl.cpp +++ b/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/ShortcutControl.cpp @@ -138,7 +138,7 @@ void ShortcutControl::AddNewShortcutControlRow(StackPanel& parent, std::vector= keyboardRemapControlObjects.size()) { return; @@ -207,7 +207,7 @@ void ShortcutControl::AddNewShortcutControlRow(StackPanel& parent, std::vector prgms = new List diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Storage/EventHandler.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Storage/EventHandler.cs index a93d12c084..9355774e6b 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Storage/EventHandler.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Storage/EventHandler.cs @@ -27,7 +27,7 @@ namespace Microsoft.Plugin.Program.Storage // Using OrdinalIgnoreCase since this is used internally with paths if (string.IsNullOrEmpty(previousAppPath) || previousAppPath.Equals(currentAppPath, StringComparison.OrdinalIgnoreCase)) { - // To dequeue a path only if it is the first one in the queue or if the path was the same as thre previous one (to avoid trying to create apps on duplicate events) + // To dequeue a path only if it is the first one in the queue or if the path was the same as the previous one (to avoid trying to create apps on duplicate events) previousAppPath = currentAppPath; eventHandlingQueue.TryDequeue(out _); } diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/WindowProcess.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/WindowProcess.cs index 97de6cd066..c7d7bd1d1f 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/WindowProcess.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/WindowProcess.cs @@ -124,7 +124,7 @@ namespace Microsoft.Plugin.WindowWalker.Components /// New process name. internal void UpdateProcessInfo(uint pid, uint tid, string name) { - // TODO: Add verification as to wether the process id and thread id is valid + // TODO: Add verification as to whether the process id and thread id is valid ProcessID = pid; ThreadID = tid; Name = name; diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index 09743eefc5..78735dc479 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -4741,7 +4741,7 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Properties { } /// - /// Looks up a localized string similar to Gets the the current time of a time zone. + /// Looks up a localized string similar to Gets the current time of a time zone. /// internal static string PluginDescription { get { diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsSettings/Classes/WindowsSetting.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsSettings/Classes/WindowsSetting.cs index 74fc2653fb..8065dc46a1 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsSettings/Classes/WindowsSetting.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsSettings/Classes/WindowsSetting.cs @@ -69,14 +69,14 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsSettings public bool ShowAsFirstResult { get; set; } /// - /// Gets or sets the the value with the generated area path as string. + /// Gets or sets the value with the generated area path as string. /// This Property IS NOT PART OF THE DATA IN "WindowsSettings.json". /// This property will be filled on runtime by "WindowsSettingsPathHelper". /// public string? JoinedAreaPath { get; set; } /// - /// Gets or sets the the value with the generated full settings path (App and areas) as string. + /// Gets or sets the value with the generated full settings path (App and areas) as string. /// This Property IS NOT PART OF THE DATA IN "WindowsSettings.json". /// This property will be filled on runtime by "WindowsSettingsPathHelper". /// diff --git a/src/modules/launcher/PowerLauncher/Helper/EnvironmentHelper.cs b/src/modules/launcher/PowerLauncher/Helper/EnvironmentHelper.cs index e383ef4e1b..272c73ee6e 100644 --- a/src/modules/launcher/PowerLauncher/Helper/EnvironmentHelper.cs +++ b/src/modules/launcher/PowerLauncher/Helper/EnvironmentHelper.cs @@ -221,9 +221,9 @@ namespace PowerLauncher.Helper } /// - /// Checks wether this process is running under the system user/account. + /// Checks whether this process is running under the system user/account. /// - /// A boolean value that indicates wether this process is running under system account (true) or not (false). + /// A boolean value that indicates whether this process is running under system account (true) or not (false). private static bool IsRunningAsSystem() { using (var identity = WindowsIdentity.GetCurrent()) diff --git a/src/modules/launcher/PowerLauncher/Properties/Settings.Designer.cs b/src/modules/launcher/PowerLauncher/Properties/Settings.Designer.cs index 66bdfe6017..499d03beca 100644 --- a/src/modules/launcher/PowerLauncher/Properties/Settings.Designer.cs +++ b/src/modules/launcher/PowerLauncher/Properties/Settings.Designer.cs @@ -26,9 +26,9 @@ namespace PowerLauncher.Properties { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("https://aka.ms/powerToys")] - public string GithubRepo { + public string GitHubRepo { get { - return ((string)(this["GithubRepo"])); + return ((string)(this["GitHubRepo"])); } } } diff --git a/src/modules/launcher/PowerLauncher/Properties/Settings.settings b/src/modules/launcher/PowerLauncher/Properties/Settings.settings index 1fc52390be..0e66ac291e 100644 --- a/src/modules/launcher/PowerLauncher/Properties/Settings.settings +++ b/src/modules/launcher/PowerLauncher/Properties/Settings.settings @@ -2,7 +2,7 @@ - + https://github.com/Wox-launcher/Wox diff --git a/src/modules/launcher/Wox.Plugin/Common/VirtualDesktop/VirtualDesktopHelper.cs b/src/modules/launcher/Wox.Plugin/Common/VirtualDesktop/VirtualDesktopHelper.cs index 1891d5dc54..42a3ed8a03 100644 --- a/src/modules/launcher/Wox.Plugin/Common/VirtualDesktop/VirtualDesktopHelper.cs +++ b/src/modules/launcher/Wox.Plugin/Common/VirtualDesktop/VirtualDesktopHelper.cs @@ -389,10 +389,10 @@ namespace Wox.Plugin.Common.VirtualDesktop.Helper /// /// Handle of the window. /// Optional the desktop id if known - /// A value indicating if the window is cloaked by Virtual Desktop Manager, because it is moved to an other desktop. + /// A value indicating if the window is cloaked by Virtual Desktop Manager, because it is moved to another desktop. public bool IsWindowCloakedByVirtualDesktopManager(IntPtr hWindow, Guid? desktop = null) { - // If a window is hidden because it is moved to an other desktop, then DWM returns type "CloakedShell". If DWM returns an other type the window is not cloaked by shell or VirtualDesktopManager. + // If a window is hidden because it is moved to another desktop, then DWM returns type "CloakedShell". If DWM returns another type the window is not cloaked by shell or VirtualDesktopManager. _ = NativeMethods.DwmGetWindowAttribute(hWindow, (int)DwmWindowAttributes.Cloaked, out int dwmCloakedState, sizeof(uint)); return GetWindowDesktopAssignmentType(hWindow, desktop) == VirtualDesktopAssignmentType.OtherDesktop && dwmCloakedState == (int)DwmWindowCloakStates.CloakedShell; } @@ -414,7 +414,7 @@ namespace Wox.Plugin.Common.VirtualDesktop.Helper int hr = _virtualDesktopManager.MoveWindowToDesktop(hWindow, desktopId); if (hr != (int)HRESULT.S_OK) { - Log.Exception($"VirtualDesktopHelper.MoveWindowToDesktop() failed: An exception was thrown when moving the window ({hWindow}) to an other desktop ({desktopId}).", Marshal.GetExceptionForHR(hr), typeof(VirtualDesktopHelper)); + Log.Exception($"VirtualDesktopHelper.MoveWindowToDesktop() failed: An exception was thrown when moving the window ({hWindow}) to another desktop ({desktopId}).", Marshal.GetExceptionForHR(hr), typeof(VirtualDesktopHelper)); return false; } diff --git a/src/modules/powerrename/PowerRenameUILib/MainWindow.xaml.cpp b/src/modules/powerrename/PowerRenameUILib/MainWindow.xaml.cpp index 273638c61e..e3d2ff7759 100644 --- a/src/modules/powerrename/PowerRenameUILib/MainWindow.xaml.cpp +++ b/src/modules/powerrename/PowerRenameUILib/MainWindow.xaml.cpp @@ -655,13 +655,13 @@ namespace winrt::PowerRenameUI::implementation } }); - // CheckBox MatchAllOccurences + // CheckBox MatchAllOccurrences checkBox_matchAll().Checked([&](auto const&, auto const&) { - ValidateFlags(MatchAllOccurences); - UpdateFlag(MatchAllOccurences, UpdateFlagCommand::Set); + ValidateFlags(MatchAllOccurrences); + UpdateFlag(MatchAllOccurrences, UpdateFlagCommand::Set); }); checkBox_matchAll().Unchecked([&](auto const&, auto const&) { - UpdateFlag(MatchAllOccurences, UpdateFlagCommand::Reset); + UpdateFlag(MatchAllOccurrences, UpdateFlagCommand::Reset); }); // ToggleButton IncludeFiles @@ -884,7 +884,7 @@ namespace winrt::PowerRenameUI::implementation { checkBox_case().IsChecked(true); } - if (flags & MatchAllOccurences) + if (flags & MatchAllOccurrences) { checkBox_matchAll().IsChecked(true); } diff --git a/src/modules/powerrename/lib/PowerRenameInterfaces.h b/src/modules/powerrename/lib/PowerRenameInterfaces.h index c25333bd4d..6623026082 100644 --- a/src/modules/powerrename/lib/PowerRenameInterfaces.h +++ b/src/modules/powerrename/lib/PowerRenameInterfaces.h @@ -6,7 +6,7 @@ enum PowerRenameFlags { CaseSensitive = 0x1, - MatchAllOccurences = 0x2, + MatchAllOccurrences = 0x2, UseRegularExpressions = 0x4, EnumerateItems = 0x8, ExcludeFiles = 0x10, diff --git a/src/modules/powerrename/lib/PowerRenameRegEx.cpp b/src/modules/powerrename/lib/PowerRenameRegEx.cpp index d0d61f414e..ec374b192d 100644 --- a/src/modules/powerrename/lib/PowerRenameRegEx.cpp +++ b/src/modules/powerrename/lib/PowerRenameRegEx.cpp @@ -270,7 +270,7 @@ HRESULT CPowerRenameRegEx::Replace(_In_ PCWSTR source, _Outptr_ PWSTR* result) if (_useBoostLib) { boost::wregex pattern(m_searchTerm, (!(m_flags & CaseSensitive)) ? boost::regex::icase | boost::regex::ECMAScript : boost::regex::ECMAScript); - if (m_flags & MatchAllOccurences) + if (m_flags & MatchAllOccurrences) { res = boost::regex_replace(wstring(source), pattern, replaceTerm); } @@ -282,7 +282,7 @@ HRESULT CPowerRenameRegEx::Replace(_In_ PCWSTR source, _Outptr_ PWSTR* result) else { std::wregex pattern(m_searchTerm, (!(m_flags & CaseSensitive)) ? regex_constants::icase | regex_constants::ECMAScript : regex_constants::ECMAScript); - if (m_flags & MatchAllOccurences) + if (m_flags & MatchAllOccurrences) { res = regex_replace(wstring(source), pattern, replaceTerm); } @@ -305,7 +305,7 @@ HRESULT CPowerRenameRegEx::Replace(_In_ PCWSTR source, _Outptr_ PWSTR* result) pos += replaceTerm.length(); } - if (!(m_flags & MatchAllOccurences)) + if (!(m_flags & MatchAllOccurrences)) { break; } diff --git a/src/modules/powerrename/unittests/PowerRenameRegExBoostTests.cpp b/src/modules/powerrename/unittests/PowerRenameRegExBoostTests.cpp index f99c9ee6b4..04c85fb1d1 100644 --- a/src/modules/powerrename/unittests/PowerRenameRegExBoostTests.cpp +++ b/src/modules/powerrename/unittests/PowerRenameRegExBoostTests.cpp @@ -149,7 +149,7 @@ TEST_METHOD(VerifyReplaceAll) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences; + DWORD flags = MatchAllOccurrences; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SearchReplaceExpected sreTable[] = { @@ -173,7 +173,7 @@ TEST_METHOD(VerifyReplaceAllCaseInsensitive) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | CaseSensitive; + DWORD flags = MatchAllOccurrences | CaseSensitive; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SearchReplaceExpected sreTable[] = { @@ -222,7 +222,7 @@ TEST_METHOD(VerifyReplaceAllUseRegEx) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions; + DWORD flags = MatchAllOccurrences | UseRegularExpressions; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SearchReplaceExpected sreTable[] = { @@ -246,7 +246,7 @@ TEST_METHOD(VerifyReplaceAllUseRegExCaseSensitive) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; + DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SearchReplaceExpected sreTable[] = { @@ -270,7 +270,7 @@ TEST_METHOD(VerifyMatchAllWildcardUseRegEx) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions; + DWORD flags = MatchAllOccurrences | UseRegularExpressions; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); // This differs from the Standard Library: .* has two matches (all and nothing). @@ -325,7 +325,7 @@ TEST_METHOD(VerifyReplaceFirstWildCardUseRegexMatchAllOccurrences) { L".*", L"Foo", L"AAAAAA", L"FooFoo" }, { L".+", L"Foo", L"AAAAAA", L"Foo" }, }; - VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), UseRegularExpressions | MatchAllOccurences); + VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), UseRegularExpressions | MatchAllOccurrences); } TEST_METHOD(VerifyReplaceFirstWildCardMatchAllOccurrences) @@ -336,7 +336,7 @@ TEST_METHOD(VerifyReplaceFirstWildCardMatchAllOccurrences) { L".*", L"Foo", L".*", L"Foo" }, { L".*", L"Foo", L".*Bar.*", L"FooBarFoo" }, }; - VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), MatchAllOccurences); + VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), MatchAllOccurrences); } TEST_METHOD(VerifyReplaceFirstWildNoFlags) @@ -355,7 +355,7 @@ TEST_METHOD(VerifyHandleCapturingGroups) // To use a capturing group followed by numbers as replacement curly braces are needed. CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; + DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SearchReplaceExpected sreTable[] = { @@ -423,7 +423,7 @@ TEST_METHOD(VerifyEventsFire) Assert::IsTrue(mockEvents->QueryInterface(IID_PPV_ARGS(®ExEvents)) == S_OK); DWORD cookie = 0; Assert::IsTrue(renameRegEx->Advise(regExEvents, &cookie) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; + DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutSearchTerm(L"FOO") == S_OK); Assert::IsTrue(renameRegEx->PutReplaceTerm(L"BAR") == S_OK); diff --git a/src/modules/powerrename/unittests/PowerRenameRegExTests.cpp b/src/modules/powerrename/unittests/PowerRenameRegExTests.cpp index 16ebfc6b42..37b16cb45d 100644 --- a/src/modules/powerrename/unittests/PowerRenameRegExTests.cpp +++ b/src/modules/powerrename/unittests/PowerRenameRegExTests.cpp @@ -143,7 +143,7 @@ TEST_METHOD(VerifyReplaceAll) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences; + DWORD flags = MatchAllOccurrences; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SearchReplaceExpected sreTable[] = { @@ -167,7 +167,7 @@ TEST_METHOD(VerifyReplaceAllCaseInsensitive) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | CaseSensitive; + DWORD flags = MatchAllOccurrences | CaseSensitive; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SearchReplaceExpected sreTable[] = { @@ -216,7 +216,7 @@ TEST_METHOD(VerifyReplaceAllUseRegEx) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions; + DWORD flags = MatchAllOccurrences | UseRegularExpressions; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SearchReplaceExpected sreTable[] = { @@ -240,7 +240,7 @@ TEST_METHOD(VerifyReplaceAllUseRegExCaseSensitive) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; + DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SearchReplaceExpected sreTable[] = { @@ -264,7 +264,7 @@ TEST_METHOD(VerifyMatchAllWildcardUseRegEx) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions; + DWORD flags = MatchAllOccurrences | UseRegularExpressions; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SearchReplaceExpected sreTable[] = { @@ -314,7 +314,7 @@ TEST_METHOD(VerifyReplaceFirstWildCardUseRegexMatchAllOccurrences) //search, replace, test, result { L".*", L"Foo", L"AAAAAA", L"Foo" }, }; - VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), UseRegularExpressions | MatchAllOccurences); + VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), UseRegularExpressions | MatchAllOccurrences); } TEST_METHOD(VerifyReplaceFirstWildCardMatchAllOccurrences) @@ -325,7 +325,7 @@ TEST_METHOD(VerifyReplaceFirstWildCardMatchAllOccurrences) { L".*", L"Foo", L".*", L"Foo" }, { L".*", L"Foo", L".*Bar.*", L"FooBarFoo" }, }; - VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), MatchAllOccurences); + VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), MatchAllOccurrences); } TEST_METHOD(VerifyReplaceFirstWildNoFlags) @@ -342,7 +342,7 @@ TEST_METHOD(VerifyHandleCapturingGroups) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; + DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SearchReplaceExpected sreTable[] = { @@ -373,7 +373,7 @@ TEST_METHOD (VerifyFileAttributesNoPadding) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions ; + DWORD flags = MatchAllOccurrences | UseRegularExpressions ; SYSTEMTIME fileTime = SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 }; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); @@ -398,7 +398,7 @@ TEST_METHOD (VerifyFileAttributesPadding) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions; + DWORD flags = MatchAllOccurrences | UseRegularExpressions; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); SYSTEMTIME fileTime = SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 }; SearchReplaceExpected sreTable[] = { @@ -422,7 +422,7 @@ TEST_METHOD (VerifyFileAttributesMonthandDayNames) { CComPtr renameRegEx; Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions; + DWORD flags = MatchAllOccurrences | UseRegularExpressions; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); std::locale::global(std::locale("")); @@ -499,7 +499,7 @@ TEST_METHOD(VerifyEventsFire) Assert::IsTrue(mockEvents->QueryInterface(IID_PPV_ARGS(®ExEvents)) == S_OK); DWORD cookie = 0; Assert::IsTrue(renameRegEx->Advise(regExEvents, &cookie) == S_OK); - DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; + DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive; Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutSearchTerm(L"FOO") == S_OK); Assert::IsTrue(renameRegEx->PutReplaceTerm(L"BAR") == S_OK); diff --git a/src/modules/previewpane/common/controls/FormHandlerControl.cs b/src/modules/previewpane/common/controls/FormHandlerControl.cs index c174f35f29..ca9b4aec1e 100644 --- a/src/modules/previewpane/common/controls/FormHandlerControl.cs +++ b/src/modules/previewpane/common/controls/FormHandlerControl.cs @@ -123,7 +123,7 @@ namespace Common // Call garbage collection at the time of unloading of Preview. // Which is preventing prevhost.exe to exit at the time of closing File explorer. // Preview Handlers run in a separate process from PowerToys. This will not affect the performance of other modules. - // Mitigate the following Github issue: https://github.com/microsoft/PowerToys/issues/1468 + // Mitigate the following GitHub issue: https://github.com/microsoft/PowerToys/issues/1468 GC.Collect(); } diff --git a/src/runner/main.cpp b/src/runner/main.cpp index 2d5b4d592a..9ddf2269aa 100644 --- a/src/runner/main.cpp +++ b/src/runner/main.cpp @@ -112,7 +112,7 @@ int runner(bool isProcessElevated, bool openSettings, std::string settingsWindow #if _DEBUG && _WIN64 //Global error handlers to diagnose errors. -//We prefer this not not show any longer until there's a bug to diagnose. +//We prefer this not to show any longer until there's a bug to diagnose. //init_global_error_handlers(); #endif Trace::RegisterProvider(); diff --git a/src/settings-ui/Settings.UI.Library/Enumerations/ColorPickerActivationAction.cs b/src/settings-ui/Settings.UI.Library/Enumerations/ColorPickerActivationAction.cs index e62173a53c..459f6ddd2b 100644 --- a/src/settings-ui/Settings.UI.Library/Enumerations/ColorPickerActivationAction.cs +++ b/src/settings-ui/Settings.UI.Library/Enumerations/ColorPickerActivationAction.cs @@ -9,7 +9,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.Enumerations // Activation shortcut opens editor OpenEditor, - // Activation shortcut opens color picker and after picking a color color is copied into clipboard and opens editor + // Activation shortcut opens color picker and after picking a color is copied into clipboard and opens editor OpenColorPickerAndThenEditor, // Activation shortcut opens color picker only and picking color copies color into clipboard diff --git a/src/settings-ui/Settings.UI/GlobalSuppressions.cs b/src/settings-ui/Settings.UI/GlobalSuppressions.cs index e81d778d60..8805526717 100644 --- a/src/settings-ui/Settings.UI/GlobalSuppressions.cs +++ b/src/settings-ui/Settings.UI/GlobalSuppressions.cs @@ -54,8 +54,8 @@ using System.Diagnostics.CodeAnalysis; // FxCop warning suppression for uninstantiated TestFixture classes [assembly: SuppressMessage("Microsoft.Performance", "CA1812: Avoid uninstantiated internal classes", Scope = "module", Justification = "CA1812 will be thrown for every file in the test project. This is mentioned here: dotnet/roslyn-analyzers#1830")] -// WindowsAppSDK files supressions -[assembly: SuppressMessage("CodeQuality", "IDE0076:Invalid global 'SuppressMessageAttribute'", Justification = "Affect predefined supressions.")] +// WindowsAppSDK files suppressions +[assembly: SuppressMessage("CodeQuality", "IDE0076:Invalid global 'SuppressMessageAttribute'", Justification = "Affect predefined suppressions.")] [assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Not part of the project. WindowsAppSDK file.", Scope = "type", Target = "~T:Microsoft.Windows.ApplicationModel.DynamicDependency.BootstrapCS.AutoInitialize")] [assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Not part of the project. WindowsAppSDK file.", Scope = "type", Target = "~T:Microsoft.WindowsAppSDK.Runtime.Version")] [assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Not part of the project. WindowsAppSDK file.", Scope = "type", Target = "~T:Microsoft.WindowsAppSDK.Runtime.Identity")]