From d105d67b34fa5958b1a23fdfd1c0ffd209db15af Mon Sep 17 00:00:00 2001 From: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Date: Thu, 2 Nov 2023 17:14:51 +0100 Subject: [PATCH 01/16] [GPO]Add Environment Variables to admx/amdl files (#29624) * [GPO] Add Environment Variables to admx/amdl files * Up the revisions to avoid gpo issues with the resource file --------- Co-authored-by: Jaime Bernardo --- src/gpo/assets/PowerToys.admx | 14 ++++++++++++-- src/gpo/assets/en-US/PowerToys.adml | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/gpo/assets/PowerToys.admx b/src/gpo/assets/PowerToys.admx index c582ff7021..9687634134 100644 --- a/src/gpo/assets/PowerToys.admx +++ b/src/gpo/assets/PowerToys.admx @@ -1,11 +1,11 @@ - + - + @@ -78,6 +78,16 @@ + + + + + + + + + + diff --git a/src/gpo/assets/en-US/PowerToys.adml b/src/gpo/assets/en-US/PowerToys.adml index fa73306193..80cc4cd187 100644 --- a/src/gpo/assets/en-US/PowerToys.adml +++ b/src/gpo/assets/en-US/PowerToys.adml @@ -1,7 +1,7 @@ - + PowerToys PowerToys @@ -112,6 +112,7 @@ Note: Changes require a restart of PowerToys Run. Awake: Configure enabled state Color Picker: Configure enabled state Crop And Lock: Configure enabled state + Environment Variables: Configure enabled state FancyZones: Configure enabled state File Locksmith: Configure enabled state SVG file preview: Configure enabled state From 0a4d30ae222013bed2ead7bf37ebb31f98565f70 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:16:29 -0400 Subject: [PATCH 02/16] [ci]check-spelling 0.0.22 (#29119) * spelling: microsoft Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: the Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * [ci]Upgrade check-spelling to v0.0.22 --------- Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- .github/actions/spell-check/advice.md | 4 +- .github/actions/spell-check/allow/allow.txt | 1 + .../actions/spell-check/allow/temporary.txt | 11 + .../actions/spell-check/candidate.patterns | 189 +++++++++++--- .github/actions/spell-check/excludes.txt | 75 +++--- .github/actions/spell-check/expect.txt | 62 ++++- .../spell-check/line_forbidden.patterns | 73 +++++- .github/actions/spell-check/patterns.txt | 232 +++++++++--------- .github/actions/spell-check/reject.txt | 1 + .github/workflows/spelling2.yml | 102 ++++++-- .../modules/powerpreview/monaco/readme.md | 2 +- .../VariantAssignmentClientSettings.cs | 2 +- 12 files changed, 532 insertions(+), 222 deletions(-) create mode 100644 .github/actions/spell-check/allow/temporary.txt diff --git a/.github/actions/spell-check/advice.md b/.github/actions/spell-check/advice.md index 1004eeaa60..84eb9218e2 100644 --- a/.github/actions/spell-check/advice.md +++ b/.github/actions/spell-check/advice.md @@ -14,7 +14,9 @@ https://www.regexplanet.com/advanced/perl/) yours before committing to verify it * well-formed pattern. - If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it, + If you can write a [pattern]( +https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns +) that would match it, try adding it to the `patterns.txt` file. Patterns are Perl 5 Regular Expressions - you can [test]( diff --git a/.github/actions/spell-check/allow/allow.txt b/.github/actions/spell-check/allow/allow.txt index 2774060a60..20a05a495d 100644 --- a/.github/actions/spell-check/allow/allow.txt +++ b/.github/actions/spell-check/allow/allow.txt @@ -9,4 +9,5 @@ sdl ssh ubuntu unuing +workarounds wil diff --git a/.github/actions/spell-check/allow/temporary.txt b/.github/actions/spell-check/allow/temporary.txt new file mode 100644 index 0000000000..05cd229158 --- /dev/null +++ b/.github/actions/spell-check/allow/temporary.txt @@ -0,0 +1,11 @@ +etw +filetime +flyouts +lnks +reparented +screenshots +SIDs +subkeys +TApp +websites +wmi diff --git a/.github/actions/spell-check/candidate.patterns b/.github/actions/spell-check/candidate.patterns index 4b40e728ee..4760fcdd18 100644 --- a/.github/actions/spell-check/candidate.patterns +++ b/.github/actions/spell-check/candidate.patterns @@ -1,23 +1,36 @@ # marker to ignore all code on line ^.*/\* #no-spell-check-line \*/.*$ -# marker for ignoring a comment to the end of the line -// #no-spell-check.*$ +# marker to ignore all code on line +^.*\bno-spell-check(?:-line|)(?:\s.*|)$ + +# https://cspell.org/configuration/document-settings/ +# cspell inline +^.*\b[Cc][Ss][Pp][Ee][Ll]{2}:\s*[Dd][Ii][Ss][Aa][Bb][Ll][Ee]-[Ll][Ii][Nn][Ee]\b # patch hunk comments ^\@\@ -\d+(?:,\d+|) \+\d+(?:,\d+|) \@\@ .* # git index header -index [0-9a-z]{7,40}\.\.[0-9a-z]{7,40} +index (?:[0-9a-z]{7,40},|)[0-9a-z]{7,40}\.\.[0-9a-z]{7,40} + +# file permissions +['"`\s][-bcdLlpsw](?:[-r][-w][-Ssx]){2}[-r][-w][-SsTtx]\+?['"`\s] + +# css url wrappings +\burl\([^)]+\) # cid urls (['"])cid:.*?\g{-1} # data url in parens -\(data:[^)]*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\) +\(data:(?:[^) ][^)]*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\) # data url in quotes -([`'"])data:.*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1} +([`'"])data:(?:[^ `'"].*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1} # data url data:[-a-zA-Z=;:/0-9+]*,\S* +# https/http/file urls +#(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|] + # mailto urls mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,} @@ -35,6 +48,9 @@ magnet:[?=:\w]+ # asciinema \basciinema\.org/a/[0-9a-zA-Z]+ +# asciinema v2 +^\[\d+\.\d+, "[io]", ".*"\]$ + # apple \bdeveloper\.apple\.com/[-\w?=/]+ # Apple music @@ -89,7 +105,7 @@ vpc-\w+ # Google Drive \bdrive\.google\.com/(?:file/d/|open)[-0-9a-zA-Z_?=]* # Google Groups -\bgroups\.google\.com/(?:(?:forum/#!|d/)(?:msg|topics?|searchin)|a)/[^/\s"]+/[-a-zA-Z0-9$]+(?:/[-a-zA-Z0-9]+)* +\bgroups\.google\.com(?:/[a-z]+/(?:#!|)[^/\s"]+)* # Google Maps \bmaps\.google\.com/maps\?[\w&;=]* # Google themes @@ -117,6 +133,8 @@ themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+. (?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|) # GitHub SHAs \bgithub\.com(?:/[^/\s"]+){2}[@#][0-9a-f]+\b +# GitHub SHA refs +\[([0-9a-f]+)\]\(https://(?:www\.|)github.com/[-\w]+/[-\w]+/commit/\g{-1}[0-9a-f]* # GitHub wiki \bgithub\.com/(?:[^/]+/){2}wiki/(?:(?:[^/]+/|)_history|[^/]+(?:/_compare|)/[0-9a-f.]{40,})\b # githubusercontent @@ -128,9 +146,9 @@ themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+. # git.io \bgit\.io/[0-9a-zA-Z]+ # GitHub JSON -"node_id": "[-a-zA-Z=;:/0-9+]*" +"node_id": "[-a-zA-Z=;:/0-9+_]*" # Contributor -\[[^\]]+\]\(https://github\.com/[^/\s"]+\) +\[[^\]]+\]\(https://github\.com/[^/\s"]+/?\) # GHSA GHSA(?:-[0-9a-z]{4}){3} @@ -143,8 +161,8 @@ GHSA(?:-[0-9a-z]{4}){3} # GitLab commits \bgitlab\.[^/\s"]*/(?:[^/\s"]+/){2}commits?/[0-9a-f]+\b -# binanace -accounts.binance.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]* +# binance +accounts\.binance\.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]* # bitbucket diff \bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}diff(?:stat|)(?:/[^/\s"]+){2}:[0-9a-f]+ @@ -280,9 +298,9 @@ slack://[a-zA-Z0-9?&=]+ \bdropbox\.com/sh?/[^/\s"]+/[-0-9A-Za-z_.%?=&;]+ # ipfs protocol -ipfs://[0-9a-z]* +ipfs://[0-9a-zA-Z]{3,} # ipfs url -/ipfs/[0-9a-z]* +/ipfs/[0-9a-zA-Z]{3,} # w3 \bw3\.org/[-0-9a-zA-Z/#.]+ @@ -359,14 +377,22 @@ ipfs://[0-9a-z]* # tinyurl \btinyurl\.com/\w+ +# codepen +\bcodepen\.io/[\w/]+ + +# registry.npmjs.org +\bregistry\.npmjs\.org/(?:@[^/"']+/|)[^/"']+/-/[-\w@.]+ + # getopts \bgetopts\s+(?:"[^"]+"|'[^']+') # ANSI color codes -(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m +(?:\\(?:u00|x)1[Bb]|\x1b|\\u\{1[Bb]\})\[\d+(?:;\d+|)m # URL escaped characters \%[0-9A-F][A-F] +# lower URL escaped characters +\%[0-9a-f][a-f](?=[a-z]{2,}) # IPv6 \b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b # c99 hex digits (not the full format, just one I've seen) @@ -376,7 +402,7 @@ ipfs://[0-9a-z]* # sha sha\d+:[0-9]*[a-f]{3,}[0-9a-f]* # sha-... -- uses a fancy capture -(['"]|")[0-9a-f]{40,}\g{-1} +(\\?['"]|")[0-9a-f]{40,}\g{-1} # hex runs \b[0-9a-fA-F]{16,}\b # hex in url queries @@ -391,18 +417,21 @@ sha\d+:[0-9]*[a-f]{3,}[0-9a-f]* # Well known gpg keys .well-known/openpgpkey/[\w./]+ +# pki +-----BEGIN.*-----END + # uuid: \b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b # hex digits including css/html color classes: -(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|u\d+)\b +(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b # integrity -integrity="sha\d+-[-a-zA-Z=;:/0-9+]{40,}" +integrity=(['"])(?:\s*sha\d+-[-a-zA-Z=;:/0-9+]{40,})+\g{-1} # https://www.gnu.org/software/groff/manual/groff.html # man troff content \\f[BCIPR] -# ' -\\\(aq +# '/" +\\\([ad]q # .desktop mime types ^MimeTypes?=.*$ @@ -411,21 +440,33 @@ integrity="sha\d+-[-a-zA-Z=;:/0-9+]{40,}" # Localized .desktop content Name\[[^\]]+\]=.* -# IServiceProvider -\bI(?=(?:[A-Z][a-z]{2,})+\b) +# IServiceProvider / isAThing +\b(?:I|isA)(?=(?:[A-Z][a-z]{2,})+\b) # crypt -"\$2[ayb]\$.{56}" +(['"])\$2[ayb]\$.{56}\g{-1} # scrypt / argon \$(?:scrypt|argon\d+[di]*)\$\S+ -# Input to GitHub JSON -content: "[-a-zA-Z=;:/0-9+]*=" +# go.sum +\bh1:\S+ -# Python stringprefix / binaryprefix +# scala modules +#("[^"]+"\s*%%?\s*){2,3}"[^"]+" + +# Input to GitHub JSON +content: (['"])[-a-zA-Z=;:/0-9+]*=\g{-1} + +# This does not cover multiline strings, if your repository has them, +# you'll want to remove the `(?=.*?")` suffix. +# The `(?=.*?")` suffix should limit the false positives rate +# printf +#%(?:(?:(?:hh?|ll?|[jzt])?[diuoxn]|l?[cs]|L?[fega]|p)(?=[a-z]{2,})|(?:X|L?[FEGA]|p)(?=[a-zA-Z]{2,}))(?=[_a-zA-Z]+\b)(?!%)(?=.*?['"]) + +# Python string prefix / binary prefix # Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings -(?|m([|!/@#,;']).*?\g{-1}) + +# perl qr regex +(?|\(.*?\)|([|!/@#,;']).*?\g{-1}) # Go regular expressions regexp?\.MustCompile\(`[^`]*`\) +# regex choice +\(\?:[^)]+\|[^)]+\) + +# proto +^\s*(\w+)\s\g{-1} = + # sed regular expressions sed 's/(?:[^/]*?[a-zA-Z]{3,}[^/]*?/){2} +# node packages +(["'])\@[^/'" ]+/[^/'" ]+\g{-1} + # go install go install(?:\s+[a-z]+\.[-@\w/.]+)+ +# jetbrains schema https://youtrack.jetbrains.com/issue/RSRP-489571 +urn:shemas-jetbrains-com + # kubernetes pod status lists # https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase \w+(?:-\w+)+\s+\d+/\d+\s+(?:Running|Pending|Succeeded|Failed|Unknown)\s+ @@ -462,19 +522,47 @@ go install(?:\s+[a-z]+\.[-@\w/.]+)+ -[0-9a-f]{10}-\w{5}\s # posthog secrets -posthog\.init\((['"])phc_[^"',]+\g{-1}, +([`'"])phc_[^"',]+\g{-1} # xcode # xcodeproject scenes -(?:Controller|ID|id)="\w{3}-\w{2}-\w{3}" +(?:Controller|destination|ID|id)="\w{3}-\w{2}-\w{3}" # xcode api botches customObjectInstantitationMethod +# configure flags +.* \| --\w{2,}.*?(?=\w+\s\w+) + # font awesome classes \.fa-[-a-z0-9]+ +# bearer auth +(['"])Bear[e][r] .*?\g{-1} + +# basic auth +(['"])Basic [-a-zA-Z=;:/0-9+]{3,}\g{-1} + +# base64 encoded content +([`'"])[-a-zA-Z=;:/0-9+]+=\g{-1} +# base64 encoded content in xml/sgml +>[-a-zA-Z=;:/0-9+]+== 0.0.22) +\\\w{2,}\{ + +# eslint +"varsIgnorePattern": ".+" + +# Windows short paths +[/\\][^/\\]{5,6}~\d{1,2}[/\\] + +# in check-spelling@v0.0.22+, printf markers aren't automatically consumed +# printf markers +#(?v# (?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) -# Compiler flags (Scala) -(?:^|[\t ,>"'`=(])-J-[DPWXY](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) -# Compiler flags -#(?:^|[\t ,"'`=(])-[DPWXYLlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) + +# Compiler flags (Unix, Java/Scala) +# Use if you have things like `-Pdocker` and want to treat them as `docker` +#(?:^|[\t ,>"'`=(])-(?:(?:J-|)[DPWXY]|[Llf])(?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) + +# Compiler flags (Windows / PowerShell) +# This is a subset of the more general compiler flags pattern. +# It avoids matching `-Path` to prevent it from being treated as `ath` +#(?:^|[\t ,"'`=(])-(?:[DPL](?=[A-Z]{2,})|[WXYlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})) # Compiler flags (linker) ,-B + # curl arguments \b(?:\\n|)curl(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)* # set arguments diff --git a/.github/actions/spell-check/excludes.txt b/.github/actions/spell-check/excludes.txt index ab49292d30..143cedf602 100644 --- a/.github/actions/spell-check/excludes.txt +++ b/.github/actions/spell-check/excludes.txt @@ -10,68 +10,87 @@ (?:^|/)FilePreviewCommon/Assets/Monaco/monacoSpecialLanguages.js (?:^|/)monacoSRC/ (?:^|/)package(?:-lock|)\.json$ +(?:^|/)Pipfile$ +(?:^|/)power-rename-ui-flags$ +(?:^|/)pyproject.toml +(?:^|/)requirements(?:-dev|-doc|-test|)\.txt$ (?:^|/)timezones\.json$ (?:^|/)vendor/ (?:^|/)WindowsSettings\.json$ -/package(?:-lock|)\.json$ -/pinyindb/ -/settings-html/ -[/.][a-z]{2}(?:-[a-zA-Z]{2}|)\. +/images/launcher/[^/]+$ +/TestFiles/ +[^/]\.gcode$ +[^/]\.rgs$ \.a$ \.ai$ +\.all-contributorsrc$ \.avi$ \.bmp$ \.bz2$ +\.cer$ \.class$ +\.coveragerc$ +\.crl$ \.crt$ -\.dat$ +\.csr$ \.dll$ \.docx?$ \.drawio$ \.DS_Store$ \.eot$ +\.eps$ \.exe$ \.filters$ -\.gcode$ \.gif$ +\.git-blame-ignore-revs$ \.gitattributes$ -\.gitignore$ +\.gitkeep$ \.graffle$ \.gz$ \.icns$ \.ico$ +\.ipynb$ \.jar$ \.jks$ \.jpe?g$ \.key$ -\.lcl$ \.lib$ \.lock$ \.map$ \.min\.. +\.mo$ \.mod$ \.mp[34]$ \.o$ \.ocf$ \.otf$ +\.p12$ +\.parquet$ \.pdf$ \.pem$ -\.PNG$ +\.pfx$ \.png$ \.psd$ \.pyc$ +\.pylintrc$ +\.qm$ \.s$ -\.stl$ -\.svg$ +\.sig$ +\.so$ \.svgz?$ +\.sys$ \.tar$ +\.tgz$ \.tiff?$ \.ttf$ \.wav$ \.webm$ \.webp$ \.woff2?$ +\.xcf$ \.xlsx?$ +\.xpm$ +\.xz$ \.zip$ ^\.github/actions/spell-check/ ^\.gitmodules$ @@ -79,38 +98,28 @@ ^\Q.pipelines/ESRPSigning_core.json\E$ ^\Qinstaller/PowerToysSetup/Settings.wxs\E$ ^\Qsrc/common/ManagedCommon/ColorFormatHelper.cs\E$ +^\Q.pipelines/sdl.gdnbaselines\E$ +^\Qsrc/common/FilePreviewCommon/Assets/Monaco/monaco_languages.json\E$ +^\Qsrc/common/notifications/BackgroundActivatorDLL/cpp.hint\E$ +^\Qsrc/modules/colorPicker/ColorPickerUI/Assets/ColorPicker/colorPicker.cur\E$ ^\Qsrc/modules/colorPicker/ColorPickerUI/Shaders/GridShader.cso\E$ ^\Qsrc/modules/MouseUtils/MouseJumpUI/MainForm.resx\E$ ^\Qsrc/modules/MouseWithoutBorders/App/Form/frmAbout.cs\E$ -^\Qsrc/modules/MouseWithoutBorders/App/Properties/AssemblyInfo.cs\E$ ^\Qsrc/modules/MouseWithoutBorders/ModuleInterface/generateSecurityDescriptor.h\E$ -^\Qsrc/settings-ui/Settings.UI.UnitTests/BackwardsCompatibility/TestFiles/CorruptJson/Microsoft/PowerToys/settings.json\E$ -^\Qsrc/settings-ui/Settings.UI.UnitTests/BackwardsCompatibility/TestFiles/v0.18.2/Microsoft/PowerToys/PowerRename/power-rename-ui-flags\E$ -^\Qsrc/settings-ui/Settings.UI.UnitTests/BackwardsCompatibility/TestFiles/v0.19.2/Microsoft/PowerToys/PowerRename/power-rename-ui-flags\E$ -^\Qsrc/settings-ui/Settings.UI.UnitTests/BackwardsCompatibility/TestFiles/v0.20.1/Microsoft/PowerToys/PowerRename/power-rename-ui-flags\E$ -^\Qsrc/settings-ui/Settings.UI.UnitTests/BackwardsCompatibility/TestFiles/V0.21.1/Microsoft/PowerToys/FancyZones/settings.json\E$ -^\Qsrc/settings-ui/Settings.UI.UnitTests/BackwardsCompatibility/TestFiles/V0.21.1/Microsoft/PowerToys/PowerRename/power-rename-ui-flags\E$ -^\Qsrc/settings-ui/Settings.UI.UnitTests/BackwardsCompatibility/TestFiles/v0.22.0/Microsoft/PowerToys/FancyZones/settings.json\E$ -^\Qsrc/settings-ui/Settings.UI.UnitTests/BackwardsCompatibility/TestFiles/v0.22.0/Microsoft/PowerToys/PowerRename/power-rename-ui-flags\E$ +^\Qsrc/modules/MouseUtils/MouseJumpUI/NativeMethods/User32/UI/WindowsAndMessaging/User32.SYSTEM_METRICS_INDEX.cs\E$ +^\Qsrc/modules/MouseWithoutBorders/App/Form/frmInputCallback.resx\E$ +^\Qsrc/modules/MouseWithoutBorders/App/Form/frmLogon.resx\E$ +^\Qsrc/modules/MouseWithoutBorders/App/Form/frmMatrix.resx\E$ +^\Qsrc/modules/MouseWithoutBorders/App/Form/frmScreen.resx\E$ +^\Qsrc/modules/peek/Peek.Common/NativeMethods.txt\E$ +^\Qsrc/modules/previewpane/SvgPreviewHandler/SvgHTMLPreviewGenerator.cs\E$ +^\Qsrc/modules/previewpane/UnitTests-StlThumbnailProvider/HelperFiles/sample.stl\E$ ^\Qtools/project_template/ModuleTemplate/resource.h\E$ ^doc/devdocs/akaLinks\.md$ -^installer/PowerToysSetup/WebView2/MicrosoftEdgeWebview2Setup.exe$ -^src/common/logger/logger\.vcxproj\.filters$ -^src/common/notifications/BackgroundActivatorDLL/BackgroundActivator\.vcxproj\.filters$ -^src/common/notifications/BackgroundActivatorDLL/cpp\.hint$ -^src/modules/colorPicker/ColorPickerUI/Assets/ColorPicker/colorPicker\.cur$ -^src/modules/fancyzones/lib/FancyZonesWinHookEventIDs\.h$ -^src/modules/imageresizer/dll/ContextMenuHandler\.rgs$ -^src/modules/imageresizer/dll/ImageResizerExt\.rgs$ -^src/modules/MouseUtils/MouseJumpUI/NativeMethods/User32/UI/WindowsAndMessaging/User32.SYSTEM_METRICS_INDEX.cs$ ^src/modules/MouseWithoutBorders/App/Form/.*\.resx$ ^src/modules/MouseWithoutBorders/App/Form/.*\.Designer\.cs$ ^src/modules/MouseWithoutBorders/App/Helper/.*\.resx$ ^src/modules/MouseWithoutBorders/App/.*/NativeMethods\.cs$ -^src/modules/peek/Peek\.Common/NativeMethods\.txt$ -^src/modules/powerrename/testapp/PowerRenameTest\.vcxproj\.filters$ -^src/modules/previewpane/PreviewPaneUnitTests/HelperFiles/MarkdownWithHTMLImageTag\.txt$ ^src/modules/previewpane/UnitTests-MarkdownPreviewHandler/HelperFiles/MarkdownWithHTMLImageTag.txt$ -^tools/CleanUp_tool/CleanUp_tool\.vcxproj\.filters$ ^tools/Verification scripts/Check preview handler registration\.ps1$ ignore$ diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 99964c5233..fbfdd418c5 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -21,6 +21,7 @@ activationaction ADDUNDORECORD ADifferent adio +adipiscing administra ADMINS adml @@ -34,6 +35,7 @@ AGGREGATABLE AHybrid ALarger alekhyareddy +aliquip ALLAPPS ALLINPUT ALLOWUNDO @@ -97,6 +99,7 @@ ASingle ASSOCCHANGED ASYNCWINDOWPLACEMENT ASYNCWINDOWPOS +ative atl atlbase atlcom @@ -150,7 +153,6 @@ BLURREGION bmi bms BNumber -Bokm BOKMAL bootstrapper BOOTSTRAPPERINSTALLFOLDER @@ -274,6 +276,7 @@ cominterop commandline COMMANDTITLE commctrl +commodo compmgmt COMPOSITIONFULL comsupp @@ -284,6 +287,8 @@ CONFIGW CONFLICTINGMODIFIERKEY CONFLICTINGMODIFIERSHORTCUT CONOUT +consectetur +consequat Consolas constexpr consts @@ -326,6 +331,7 @@ CTRLALTDEL Ctrls Ctx CUI +cupidatat currentculture CURRENTDIR CURSORINFO @@ -372,6 +378,7 @@ dcomp DComposition dcr dcs +ddd DDEIf DDevice ddf @@ -398,12 +405,12 @@ DELETEDKEYIMAGE DELETESCANS deletethis Delimarsky -dend DENORMAL Deondre depersist deprioritized deref +deserunt DESKTOPABSOLUTEEDITING DESKTOPABSOLUTEPARSING desktopshorcutinstalled @@ -484,6 +491,7 @@ dxgidebug dxgiformat dxguid ecount +ecyclebin EData Edid EDITKEYBOARD @@ -491,8 +499,13 @@ editkeyboardwindow EDITSHORTCUTS editshortcutswindow EFile +egistry +egistrypreview eip ekus +elease +elemetry +elit emmintrin Emoji ENABLEDELAYEDEXPANSION @@ -503,6 +516,7 @@ encryptor endpointvolume endregion ENDSESSION +enim ENTERSIZEMOVE ENU EOAC @@ -517,10 +531,16 @@ ERRORLEVEL ERRORTITLE ESettings esize +esource esrp +estapp +estart +ests +esult etl etstat -etw +ETW +etwork EUQ eurochange eventlog @@ -538,6 +558,7 @@ exabyte examplehandler examplepowertoy EXAND +Excepteur EXCLUDEFROMCAPTURE exdisp executionpolicy @@ -548,6 +569,8 @@ exlist EXPCMDFLAGS EXPCMDSTATE explr +exppowertoys +exptas exsb EXSEL exstyle @@ -575,7 +598,7 @@ FILEOP FILEOS FILESUBTYPE FILESYSPATH -filetime +Filetime FILEVERSION Filtergraph Filterkeyboard @@ -585,6 +608,7 @@ findfast firefox FIXEDFILEINFO flyout +flyouts FOF FOFX FOLDERID @@ -907,6 +931,8 @@ killrunner Knownfolders KSPROPERTY Kybd +laboris +laborum LAlt Lambson langword @@ -957,6 +983,7 @@ lmcons LMEM LMENU lnk +lnks LOADFROMFILE LOBYTE LOCALAPPDATA @@ -1110,6 +1137,7 @@ mockapi MODECHANGE modernwpf MODESPRUNED +mollit MONITORENUMPROC MONITORINFO MONITORINFOEX @@ -1182,6 +1210,7 @@ NCMBUTTONUP NCMOUSELEAVE NCMOUSEMOVE NCol +nconsectetur ncpa NCPAINT NCRBUTTONDBLCLK @@ -1206,7 +1235,6 @@ newitem newpath newrow Newtonsoft -niels nielslaute NIF nint @@ -1249,6 +1277,7 @@ NORMALUSER NOSEARCH NOSENDCHANGING NOSIZE +nostrud notfound NOTIFICATIONSDLL NOTIFYICONDATAW @@ -1264,6 +1293,7 @@ NOZORDER NPH NResize nrw +nsunt NTAPI ntdll ntfs @@ -1280,12 +1310,15 @@ Objbase OBJID objidl oblitum +obmikh +occaecat ocr Ocrsettings odbc odbccp Oem officehubintl +officia ofs oid oldcolor @@ -1302,6 +1335,7 @@ onenote onstd oobe OOBEPT +ools opencode opensource openxmlformats @@ -1315,6 +1349,8 @@ ostr OSVERSIONINFOEX OSVERSIONINFOEXW osvi +otating +otifications OUTOFCONTEXT OUTOFMEMORY outpin @@ -1461,6 +1497,7 @@ PRODUCTVERSION Progman programdata PROGRAMFILES +proident projectname PROPBAG PROPERTYKEY @@ -1541,6 +1578,7 @@ RECTL rectp rects RECTSOURCE +recyclebin redirectedfrom Redist redistributable @@ -1579,6 +1617,7 @@ renamable RENAMEONCOLLISION Renamer reparent +reparented reparenting reparse reportbug @@ -1612,6 +1651,7 @@ RIGHTDOWN RIGHTSCROLLBAR RIGHTUP riid +ringbuffer RKey RLO RMENU @@ -1671,13 +1711,13 @@ Scode scoobe SCOPEID screenshot +screenshots scrollviewer sddl SDKDDK sdns searchterm secpol -Secur Segoe Sekan SENDCHANGE @@ -1753,6 +1793,7 @@ sia SIATTRIBFLAGS SICHINT sid +SIDs siex sigdn SIGNINGSCENARIO @@ -1853,6 +1894,7 @@ stylecop Subdir subfolders subkey +subkeys SUBLANG subquery subresource @@ -1888,7 +1930,7 @@ SYSTEMTIME sysvol Tadele talynone -TApp +tapp TApplication TApplied targ @@ -1966,6 +2008,7 @@ Tsd TServer TStr TValue +tweakme TWF tymed typedef @@ -1988,6 +2031,7 @@ UIEx uipi UIs ULARGE +ullamco ULONGLONG ums unapply @@ -2009,6 +2053,7 @@ unknwn UNLEN Unmap unmute +unner UNORM unregistering unremapped @@ -2117,6 +2162,7 @@ webpage websearch webserver website +websites wekyb Wevtapi wgpocpl @@ -2187,7 +2233,7 @@ WKSG Wlkr wmain Wman -wmi +WMI WMICIM wmimgmt WMKEYDOWN diff --git a/.github/actions/spell-check/line_forbidden.patterns b/.github/actions/spell-check/line_forbidden.patterns index e8c5179a47..8ddb666cd6 100644 --- a/.github/actions/spell-check/line_forbidden.patterns +++ b/.github/actions/spell-check/line_forbidden.patterns @@ -1,4 +1,6 @@ -# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere +# reject `m_data` as VxWorks defined it and that breaks things if it's used elsewhere +# see [fprime](https://github.com/nasa/fprime/commit/d589f0a25c59ea9a800d851ea84c2f5df02fb529) +# and [Qt](https://github.com/qtproject/qt-solutions/blame/fb7bc42bfcc578ff3fa3b9ca21a41e96eb37c1c7/qtscriptclassic/src/qscriptbuffer_p.h#L46) # \bm_data\b # If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test, @@ -6,40 +8,72 @@ # to use this: #\bfit\( +# s.b. anymore +\bany more[,.] + # s.b. GitHub -\bGithub\b +(?v# +(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) + +# hit-count: 209 file-count: 97 # w3 \bw3\.org/[-0-9a-zA-Z/#.]+ -# hit-count: 47 file-count: 3 +# hit-count: 137 file-count: 38 +# alternate markers if you run into latex and friends +(?]|\b)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{10,12}(?:\g{-1}|[<})>]) -# c99 hex digits (not the full format, just one I've seen) -0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP] - -# URL escaped characters -\%[0-9A-F]{2} - -# wregex -std::wregex\(L"[^"]*"\) - -# hash -Hash="[0-9A-F]{40}" -# SHA256 hash -'[0-9A-F]{64}' - -# 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 - (?:L"[abAB]+", ){3}L"[abAB]+" -"Lorem[^"]+?\." -TestCase\("[^"]+" -# Test line with hexadecimal colors -\[DataRow\("[0-9A-F]{6}", \d{3}, \d{3}, \d{3}\)\] -\[DataRow\("[0-9A-F]{6}", \d{3}.\d{1}, \d{3}.\d{1}, \d{3}.\d{1}\)\] -\[DataRow\("[0-9A-F]{6}", "[BCGMRY]\d\d?", \d{3}, \d{3}\)\] - -# version suffix v# -[Vv]\d+(?:\b|(?=[a-zA-Z_])) - -# Windows paths -\\native -\\netcoreapp -\\netstandard -\\network -\\notifications -\\recyclebin -\\Registry -\\registry -\\reinstall -\\release -\\Resize -\\resource -\\Resources -\\restart -\\restore -\\result -\\robmikh -\\rotating -\\runner -\\runtimes -\\Telemetry -\\telemetry -\\testapp -\\tests -\\tools - -# plugin.json -^ "ID": "[0-9A-F]{32}",$ +# hit-count: 1 file-count: 1 +# marker to ignore all code on line +^.*/\* #no-spell-check-line \*/.*$ # UnitTests \[DataRow\(.*\)\] -# Id info inside markdown file (registry.md) -^\|\s+ID\s+\|\s*\`[0-9A-F]{32}\` - -# TestCase strings intentionally have non dictionary items -\[TestCase\(new string.*\] - # D2D D?2D -# marker for ignoring a comment to the end of the line -^.*/\* #no-spell-check-line \*/.*$ -// #no-spell-check.*$ +# hit-count: 1 file-count: 1 +# GHSA +GHSA(?:-[0-9a-z]{4}){3} -http://tes/ +# hit-count: 1 file-count: 1 +# medium +\bmedium\.com/\@?[^/\s"]+/[-\w]+ +# hit-count: 1 file-count: 1 +# kubectl.kubernetes.io/last-applied-configuration +"kubectl.kubernetes.io/last-applied-configuration": ".*" + +# hit-count: 1 file-count: 1 # tar arguments -\b(?:\\n|)tar(?:\s+-[a-zA-Z]+|\s[a-z]+)+ +\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+ + +\bSecur32 -# fabricbot.json -"id": "\S+" -"commentPattern": ".*" # Questionably acceptable forms of `in to` # Personally, I prefer `log into`, but people object # https://www.tprteaching.com/log-into-log-in-to-login/ -\b[Ll]og in to\b +\b(?:[Ll]og|[Ss]ign) in to\b + +# to opt in +\bto opt in\b # acceptable duplicates # ls directory listings -# /bin/ls -l output -[-bcdlpsw](?:[-r][-w][-sx]){3}\s+\d+\s+(\S+)\s+\g{-1}\s+\d+\s+ +[-bcdlpsw](?:[-r][-w][-Ssx]){3}\s+\d+\s+\S+\s+\S+\s+\d+\s+ +# mount +\bmount\s+-t\s+(\w+)\s+\g{-1}\b # C types and repeated CSS values -\s(center|div|inherit|long|LONG|none|normal|solid|thin|transparent|very)(?: \g{-1})+\s +\s(auto|center|div|inherit|long|LONG|none|normal|solid|thin|transparent|very)(?: \g{-1})+\s +# C struct +\bstruct\s+(\w+)\s+\g{-1}\b # go templates -\s(\w+)\s+\g{-1}\s+\`(?:graphql|json|yaml): -# javadoc / .net -(?:[\\@](?:groupname|param)|(?:public|private)(?:\s+static|\s+readonly)*)\s+(\w+)\s+\g{-1}\s +\s(\w+)\s+\g{-1}\s+\`(?:graphql|inject|json|yaml): +# doxygen / javadoc / .net +(?:[\\@](?:brief|groupname|t?param|return|retval)|(?:public|private|\[Parameter(?:\(.+\)|)\])(?:\s+static|\s+override|\s+readonly)*)(?:\s+\{\w+\}|)\s+(\w+)\s+\g{-1}\s # Commit message -- Signed-off-by and friends ^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$ diff --git a/.github/actions/spell-check/reject.txt b/.github/actions/spell-check/reject.txt index b5a6d36809..e5e4c3eef8 100644 --- a/.github/actions/spell-check/reject.txt +++ b/.github/actions/spell-check/reject.txt @@ -1,4 +1,5 @@ ^attache$ +^bellow$ benefitting occurences? ^dependan.* diff --git a/.github/workflows/spelling2.yml b/.github/workflows/spelling2.yml index 0cbb2ce08c..d58828a50e 100644 --- a/.github/workflows/spelling2.yml +++ b/.github/workflows/spelling2.yml @@ -5,7 +5,7 @@ name: Spell checking # https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Restricted-Permissions # # `jobs.comment-push` runs when a push is made to a repository and the `jobs.spelling` job needs to make a comment -# (in odd cases, it might actually run just to collapse a commment, but that's fairly rare) +# (in odd cases, it might actually run just to collapse a comment, but that's fairly rare) # it needs `contents: write` in order to add a comment. # # `jobs.comment-pr` runs when a pull_request is made to a repository and the `jobs.spelling` job needs to make a comment @@ -34,6 +34,29 @@ name: Spell checking # # For background, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-with-deploy-key +# Sarif reporting +# +# Access to Sarif reports is generally restricted (by GitHub) to members of the repository. +# +# Requires enabling `security-events: write` +# and configuring the action with `use_sarif: 1` +# +# For information on the feature, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Sarif-output + +# Minimal workflow structure: +# +# on: +# push: +# ... +# pull_request_target: +# ... +# jobs: +# # you only want the spelling job, all others should be omitted +# spelling: +# # remove `security-events: write` and `use_sarif: 1` +# # remove `experimental_apply_changes_via_bot: 1` +# ... otherwise adjust the `with:` as you wish + on: push: branches: @@ -43,12 +66,13 @@ on: pull_request_target: branches: - "**" - tags-ignore: - - "**" types: - 'opened' - 'reopened' - 'synchronize' + issue_comment: + types: + - 'created' jobs: spelling: @@ -57,10 +81,11 @@ jobs: contents: read pull-requests: read actions: read + security-events: write outputs: followup: ${{ steps.spelling.outputs.followup }} runs-on: ubuntu-latest - if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'" + if: ${{ contains(github.event_name, 'pull_request') || github.event_name == 'push' }} concurrency: group: spelling-${{ github.event.pull_request.number || github.ref }} # note: If you use only_check_changed_files, you do not want cancel-in-progress @@ -68,24 +93,45 @@ jobs: steps: - name: check-spelling id: spelling - uses: check-spelling/check-spelling@v0.0.21 + uses: check-spelling/check-spelling@v0.0.22 with: config: .github/actions/spell-check - suppress_push_for_open_pull_request: 1 + suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }} checkout: true check_file_names: 1 - spell_check_this: check-spelling/spell-check-this@prerelease + spell_check_this: microsoft/PowerToys@main post_comment: 0 use_magic_file: 1 - extra_dictionary_limit: 10 + warnings: bad-regex,binary-file,deprecated-feature,ignored-expect-variant,large-file,limited-references,no-newline-at-eof,noisy-file,non-alpha-in-dictionary,token-is-substring,unexpected-line-ending,whitespace-in-dictionary,minified-file,unsupported-configuration,no-files-to-check + experimental_apply_changes_via_bot: ${{ github.repository_owner != 'microsoft' && 1 }} + use_sarif: ${{ (!github.event.pull_request || (github.event.pull_request.head.repo.full_name == github.repository)) && 1 }} + extra_dictionary_limit: 20 extra_dictionaries: - cspell:software-terms/src/software-terms.txt + cspell:software-terms/dict/softwareTerms.txt cspell:cpp/src/stdlib-cpp.txt cspell:filetypes/filetypes.txt cspell:cpp/src/stdlib-c.txt - cspell:fullstack/fullstack.txt - cspell:html/html.txt - cspell:css/css.txt + cspell:python/src/python/python-lib.txt + cspell:lorem-ipsum/dictionary.txt + cspell:php/dict/php.txt + cspell:typescript/dict/typescript.txt + cspell:swift/src/swift.txt + cspell:fullstack/dict/fullstack.txt + cspell:node/dict/node.txt + cspell:dotnet/dict/dotnet.txt + cspell:django/dict/django.txt + cspell:python/src/python/python.txt + cspell:csharp/csharp.txt + cspell:python/src/common/extra.txt + cspell:cpp/src/compiler-msvc.txt + cspell:aws/aws.txt + cspell:golang/dict/go.txt + cspell:java/src/java.txt + cspell:html/dict/html.txt + cspell:css/dict/css.txt + cspell:k8s/dict/k8s.txt + cspell:java/src/java-terms.txt + cspell:powershell/dict/powershell.txt comment-push: name: Report (Push) @@ -97,11 +143,11 @@ jobs: if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push' steps: - name: comment - uses: check-spelling/check-spelling@v0.0.21 + uses: check-spelling/check-spelling@v0.0.22 with: config: .github/actions/spell-check checkout: true - spell_check_this: check-spelling/spell-check-this@prerelease + spell_check_this: microsoft/PowerToys@main task: ${{ needs.spelling.outputs.followup }} comment-pr: @@ -110,13 +156,39 @@ jobs: runs-on: ubuntu-latest needs: spelling permissions: + contents: read pull-requests: write if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request') steps: - name: comment - uses: check-spelling/check-spelling@v0.0.21 + uses: check-spelling/check-spelling@v0.0.22 with: config: .github/actions/spell-check checkout: true spell_check_this: check-spelling/spell-check-this@prerelease task: ${{ needs.spelling.outputs.followup }} + experimental_apply_changes_via_bot: ${{ github.repository_owner != 'microsoft' && 1 }} + + update: + name: Update PR + permissions: + contents: write + pull-requests: write + actions: read + runs-on: ubuntu-latest + if: ${{ + github.repository_owner != 'microsoft' && + github.event_name == 'issue_comment' && + github.event.issue.pull_request && + contains(github.event.comment.body, '@check-spelling-bot apply') + }} + concurrency: + group: spelling-update-${{ github.event.issue.number }} + cancel-in-progress: false + steps: + - name: apply spelling updates + uses: check-spelling/check-spelling@v0.0.22 + with: + experimental_apply_changes_via_bot: ${{ github.repository_owner != 'microsoft' && 1 }} + checkout: true + ssh_key: "${{ secrets.CHECK_SPELLING }}" diff --git a/doc/devdocs/modules/powerpreview/monaco/readme.md b/doc/devdocs/modules/powerpreview/monaco/readme.md index 93bbf743c9..ac9ae3eae2 100644 --- a/doc/devdocs/modules/powerpreview/monaco/readme.md +++ b/doc/devdocs/modules/powerpreview/monaco/readme.md @@ -1,6 +1,6 @@ # Developer Preview (Monaco) -Developer preview is based on [Microsofts Monaco Editor](https://microsoft.github.io/monaco-editor/) which is maintained by the Visual Studio Code team. +Developer preview is based on [Microsoft's Monaco Editor](https://microsoft.github.io/monaco-editor/) which is maintained by the Visual Studio Code team. ## Update monaco editor diff --git a/src/common/AllExperiments/Microsoft.VariantAssignment/Contract/VariantAssignmentClientSettings.cs b/src/common/AllExperiments/Microsoft.VariantAssignment/Contract/VariantAssignmentClientSettings.cs index 1ea295bfda..f57986368c 100644 --- a/src/common/AllExperiments/Microsoft.VariantAssignment/Contract/VariantAssignmentClientSettings.cs +++ b/src/common/AllExperiments/Microsoft.VariantAssignment/Contract/VariantAssignmentClientSettings.cs @@ -24,7 +24,7 @@ namespace Microsoft.VariantAssignment.Contract public bool EnableCaching { get; set; } /// - /// Gets or sets the the maximum time a cached variant assignment response may be used without re-validating. + /// Gets or sets the maximum time a cached variant assignment response may be used without re-validating. /// public TimeSpan ResponseCacheTime { get; set; } } From 4060df8c64e192acd2a7bea5ff5eafaf6c5ef439 Mon Sep 17 00:00:00 2001 From: Davide Giacometti Date: Fri, 3 Nov 2023 10:53:00 +0100 Subject: [PATCH 03/16] [Chore]Update WebView2 dependency to 1.0.2088.41 (#29416) --- Directory.Packages.props | 6 +++--- NOTICE.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f96998afaa..912d7111e6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -12,7 +12,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -79,4 +79,4 @@ - + \ No newline at end of file diff --git a/NOTICE.md b/NOTICE.md index 52eb8b86c1..2567fd3ce4 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -336,7 +336,7 @@ SOFTWARE. - Microsoft.Extensions.Logging 7.0.0 - Microsoft.NET.Test.Sdk 17.6.3 - Microsoft.Toolkit.Uwp.Notifications 7.1.2 -- Microsoft.Web.WebView2 1.0.1722.45 +- Microsoft.Web.WebView2 1.0.2088.41 - Microsoft.Windows.Compatibility 7.0.3 - Microsoft.Windows.CsWin32 0.2.46-beta - Microsoft.Windows.CsWinRT 2.0.3 From 47aa28977ce093650b532fc13235369b8add687e Mon Sep 17 00:00:00 2001 From: David Lascelles <60486882+davidtlascelles@users.noreply.github.com> Date: Fri, 3 Nov 2023 12:13:25 +0200 Subject: [PATCH 04/16] [QuickAccent]Add support for Finnish (#29483) * Add support for Finnish * Also add FI to GetDefaultLetterKeyALL * Fix missing space --- .../poweraccent/PowerAccent.Core/Languages.cs | 15 +++++++++++++++ .../SettingsXAML/Views/PowerAccentPage.xaml | 1 + .../Settings.UI/Strings/en-us/Resources.resw | 3 +++ .../ViewModels/PowerAccentViewModel.cs | 1 + 4 files changed, 20 insertions(+) diff --git a/src/modules/poweraccent/PowerAccent.Core/Languages.cs b/src/modules/poweraccent/PowerAccent.Core/Languages.cs index d025213a1c..e00f806a43 100644 --- a/src/modules/poweraccent/PowerAccent.Core/Languages.cs +++ b/src/modules/poweraccent/PowerAccent.Core/Languages.cs @@ -18,6 +18,7 @@ namespace PowerAccent.Core GD, DE, EST, + FI, FR, HR, HE, @@ -56,6 +57,7 @@ namespace PowerAccent.Core Language.GD => GetDefaultLetterKeyGD(letter), // Gàidhlig (Scottish Gaelic) Language.DE => GetDefaultLetterKeyDE(letter), // German Language.EST => GetDefaultLetterKeyEST(letter), // Estonian + Language.FI => GetDefaultLetterKeyFI(letter), // Finnish Language.FR => GetDefaultLetterKeyFR(letter), // French Language.HR => GetDefaultLetterKeyHR(letter), // Croatian Language.HE => GetDefaultLetterKeyHE(letter), // Hebrew @@ -97,6 +99,7 @@ namespace PowerAccent.Core .Union(GetDefaultLetterKeyGD(letter)) .Union(GetDefaultLetterKeyDE(letter)) .Union(GetDefaultLetterKeyEST(letter)) + .Union(GetDefaultLetterKeyFI(letter)) .Union(GetDefaultLetterKeyFR(letter)) .Union(GetDefaultLetterKeyHR(letter)) .Union(GetDefaultLetterKeyHE(letter)) @@ -221,6 +224,18 @@ namespace PowerAccent.Core }; } + // Finnish + private static string[] GetDefaultLetterKeyFI(LetterKey letter) + { + return letter switch + { + LetterKey.VK_A => new[] { "ä", "å" }, + LetterKey.VK_E => new[] { "€" }, + LetterKey.VK_O => new[] { "ö" }, + _ => Array.Empty(), + }; + } + // French private static string[] GetDefaultLetterKeyFR(LetterKey letter) { diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml index 89ac7f5c6f..d66b074dcf 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml @@ -53,6 +53,7 @@ + diff --git a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw index 196a55815f..074f0bf25e 100644 --- a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw @@ -3333,6 +3333,9 @@ Activate by holding the key for the character you want to add an accent to, then French + + Finnish + Estonian diff --git a/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs index dda389ccb8..3a6fd03c70 100644 --- a/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs @@ -32,6 +32,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels "GD", "NL", "EST", + "FI", "FR", "DE", "HE", From 4875564a598a94cabe7a929f8f8129b865973975 Mon Sep 17 00:00:00 2001 From: Davide Giacometti Date: Fri, 3 Nov 2023 12:11:57 +0100 Subject: [PATCH 05/16] [Peek]Use space to play/resume video (#29487) --- .../peek/Peek.FilePreviewer/FilePreview.xaml | 3 +++ .../Peek.FilePreviewer/FilePreview.xaml.cs | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/modules/peek/Peek.FilePreviewer/FilePreview.xaml b/src/modules/peek/Peek.FilePreviewer/FilePreview.xaml index 1f2329c987..674cd85079 100644 --- a/src/modules/peek/Peek.FilePreviewer/FilePreview.xaml +++ b/src/modules/peek/Peek.FilePreviewer/FilePreview.xaml @@ -40,6 +40,9 @@ Source="{x:Bind VideoPreviewer.Preview, Mode=OneWay}" ToolTipService.ToolTip="{x:Bind ImageInfoTooltip, Mode=OneWay}" Visibility="{x:Bind IsPreviewVisible(VideoPreviewer, Previewer.State), Mode=OneWay}"> + + + Date: Fri, 3 Nov 2023 15:46:14 +0100 Subject: [PATCH 06/16] [Run][VSCode]Fix plugin initialization failing with trailing backslash in path (#29547) --- .../VSCodeHelper/VSCodeInstances.cs | 151 ++++++++++-------- 1 file changed, 82 insertions(+), 69 deletions(-) diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/VSCodeHelper/VSCodeInstances.cs b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/VSCodeHelper/VSCodeInstances.cs index 86837628a3..213dbed511 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/VSCodeHelper/VSCodeInstances.cs +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/VSCodeHelper/VSCodeInstances.cs @@ -71,77 +71,90 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.VSCodeHelper foreach (var path in paths) { - if (Directory.Exists(path)) + if (!Directory.Exists(path)) { - var files = Directory.GetFiles(path) - .Where(x => (x.Contains("code", StringComparison.OrdinalIgnoreCase) || x.Contains("codium", StringComparison.OrdinalIgnoreCase)) - && !x.EndsWith(".cmd", StringComparison.OrdinalIgnoreCase)).ToArray(); - - var iconPath = Path.GetDirectoryName(path); - - if (files.Length > 0) - { - var file = files[0]; - var version = string.Empty; - - var instance = new VSCodeInstance - { - ExecutablePath = file, - }; - - if (file.EndsWith("code", StringComparison.OrdinalIgnoreCase)) - { - version = "Code"; - instance.VSCodeVersion = VSCodeVersion.Stable; - } - else if (file.EndsWith("code-insiders", StringComparison.OrdinalIgnoreCase)) - { - version = "Code - Insiders"; - instance.VSCodeVersion = VSCodeVersion.Insiders; - } - else if (file.EndsWith("code-exploration", StringComparison.OrdinalIgnoreCase)) - { - version = "Code - Exploration"; - instance.VSCodeVersion = VSCodeVersion.Exploration; - } - else if (file.EndsWith("codium", StringComparison.OrdinalIgnoreCase)) - { - version = "VSCodium"; - instance.VSCodeVersion = VSCodeVersion.Stable; - } - else if (file.EndsWith("codium-insiders", StringComparison.OrdinalIgnoreCase)) - { - version = "VSCodium - Insiders"; - instance.VSCodeVersion = VSCodeVersion.Insiders; - } - - if (version != string.Empty) - { - var portableData = Path.Join(iconPath, "data"); - instance.AppData = Directory.Exists(portableData) ? Path.Join(portableData, "user-data") : Path.Combine(_userAppDataPath, version); - - var vsCodeIconPath = Path.Join(iconPath, $"{version}.exe"); - var vsCodeIcon = Icon.ExtractAssociatedIcon(vsCodeIconPath); - - if (vsCodeIcon != null) - { - using var vsCodeIconBitmap = vsCodeIcon.ToBitmap(); - - // workspace - using var folderIcon = (Bitmap)Image.FromFile(Path.Join(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Images//folder.png")); - using var bitmapFolderIcon = BitmapOverlayToCenter(folderIcon, vsCodeIconBitmap); - instance.WorkspaceIconBitMap = Bitmap2BitmapImage(bitmapFolderIcon); - - // remote - using var monitorIcon = (Bitmap)Image.FromFile(Path.Join(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Images//monitor.png")); - using var bitmapMonitorIcon = BitmapOverlayToCenter(monitorIcon, vsCodeIconBitmap); - instance.RemoteIconBitMap = Bitmap2BitmapImage(bitmapMonitorIcon); - } - - Instances.Add(instance); - } - } + continue; } + + var files = Directory.GetFiles(path) + .Where(x => (x.Contains("code", StringComparison.OrdinalIgnoreCase) || x.Contains("codium", StringComparison.OrdinalIgnoreCase)) + && !x.EndsWith(".cmd", StringComparison.OrdinalIgnoreCase)).ToArray(); + + // Remove the trailing backslash to always get the correct path + var iconPath = Path.GetDirectoryName(path.TrimEnd('\\')); + + if (files.Length == 0) + { + continue; + } + + var file = files[0]; + var version = string.Empty; + + var instance = new VSCodeInstance + { + ExecutablePath = file, + }; + + if (file.EndsWith("code", StringComparison.OrdinalIgnoreCase)) + { + version = "Code"; + instance.VSCodeVersion = VSCodeVersion.Stable; + } + else if (file.EndsWith("code-insiders", StringComparison.OrdinalIgnoreCase)) + { + version = "Code - Insiders"; + instance.VSCodeVersion = VSCodeVersion.Insiders; + } + else if (file.EndsWith("code-exploration", StringComparison.OrdinalIgnoreCase)) + { + version = "Code - Exploration"; + instance.VSCodeVersion = VSCodeVersion.Exploration; + } + else if (file.EndsWith("codium", StringComparison.OrdinalIgnoreCase)) + { + version = "VSCodium"; + instance.VSCodeVersion = VSCodeVersion.Stable; + } + else if (file.EndsWith("codium-insiders", StringComparison.OrdinalIgnoreCase)) + { + version = "VSCodium - Insiders"; + instance.VSCodeVersion = VSCodeVersion.Insiders; + } + + if (string.IsNullOrEmpty(version)) + { + continue; + } + + var portableData = Path.Join(iconPath, "data"); + instance.AppData = Directory.Exists(portableData) ? Path.Join(portableData, "user-data") : Path.Combine(_userAppDataPath, version); + var vsCodeIconPath = Path.Join(iconPath, $"{version}.exe"); + if (!File.Exists(vsCodeIconPath)) + { + continue; + } + + var vsCodeIcon = Icon.ExtractAssociatedIcon(vsCodeIconPath); + + if (vsCodeIcon == null) + { + continue; + } + + using var vsCodeIconBitmap = vsCodeIcon.ToBitmap(); + + // Workspace + using var folderIcon = (Bitmap)Image.FromFile(Path.Join(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Images//folder.png")); + using var bitmapFolderIcon = BitmapOverlayToCenter(folderIcon, vsCodeIconBitmap); + instance.WorkspaceIconBitMap = Bitmap2BitmapImage(bitmapFolderIcon); + + // Remote + using var monitorIcon = (Bitmap)Image.FromFile(Path.Join(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Images//monitor.png")); + using var bitmapMonitorIcon = BitmapOverlayToCenter(monitorIcon, vsCodeIconBitmap); + instance.RemoteIconBitMap = Bitmap2BitmapImage(bitmapMonitorIcon); + + Instances.Add(instance); } } } From 16e26a200e7f1349ba4bc4c16dc0fbee8fb51760 Mon Sep 17 00:00:00 2001 From: Davide Giacometti Date: Fri, 3 Nov 2023 17:10:26 +0100 Subject: [PATCH 07/16] [Hosts]Handle read-only hosts file (#29562) * handle read-only hosts file --- .../Hosts/Hosts.Tests/HostsServiceTest.cs | 55 +++++++++++++------ .../NotRunningElevatedException.cs | 2 +- .../Exceptions/ReadOnlyHostsException.cs | 12 ++++ .../Hosts/Hosts/Helpers/HostsService.cs | 15 +++++ .../Hosts/Hosts/Helpers/IHostsService.cs | 2 + .../Hosts/Hosts/HostsXAML/Views/MainPage.xaml | 15 ++++- .../Hosts/Hosts/Strings/en-us/Resources.resw | 7 +++ .../Hosts/Hosts/ViewModels/MainViewModel.cs | 19 +++++++ 8 files changed, 106 insertions(+), 21 deletions(-) rename src/modules/Hosts/Hosts/{Helpers => Exceptions}/NotRunningElevatedException.cs (91%) create mode 100644 src/modules/Hosts/Hosts/Exceptions/ReadOnlyHostsException.cs diff --git a/src/modules/Hosts/Hosts.Tests/HostsServiceTest.cs b/src/modules/Hosts/Hosts.Tests/HostsServiceTest.cs index c75c0ce1b6..d76beebd60 100644 --- a/src/modules/Hosts/Hosts.Tests/HostsServiceTest.cs +++ b/src/modules/Hosts/Hosts.Tests/HostsServiceTest.cs @@ -5,6 +5,7 @@ using System.IO.Abstractions.TestingHelpers; using System.Linq; using System.Threading.Tasks; +using Hosts.Exceptions; using Hosts.Helpers; using Hosts.Models; using Hosts.Settings; @@ -18,11 +19,13 @@ namespace Hosts.Tests [TestClass] public class HostsServiceTest { + private static Mock _userSettings; private static Mock _elevationHelper; [ClassInitialize] public static void ClassInitialize(TestContext context) { + _userSettings = new Mock(); _elevationHelper = new Mock(); _elevationHelper.Setup(m => m.IsElevated).Returns(true); } @@ -31,8 +34,7 @@ namespace Hosts.Tests public void Hosts_Exists() { var fileSystem = new CustomMockFileSystem(); - var userSettings = new Mock(); - var service = new HostsService(fileSystem, userSettings.Object, _elevationHelper.Object); + var service = new HostsService(fileSystem, _userSettings.Object, _elevationHelper.Object); fileSystem.AddFile(service.HostsFilePath, new MockFileData(string.Empty)); var result = service.Exists(); @@ -43,8 +45,7 @@ namespace Hosts.Tests public void Hosts_Not_Exists() { var fileSystem = new CustomMockFileSystem(); - var userSettings = new Mock(); - var service = new HostsService(fileSystem, userSettings.Object, _elevationHelper.Object); + var service = new HostsService(fileSystem, _userSettings.Object, _elevationHelper.Object); var result = service.Exists(); Assert.IsFalse(result); @@ -65,8 +66,7 @@ namespace Hosts.Tests "; var fileSystem = new CustomMockFileSystem(); - var userSettings = new Mock(); - var service = new HostsService(fileSystem, userSettings.Object, _elevationHelper.Object); + var service = new HostsService(fileSystem, _userSettings.Object, _elevationHelper.Object); fileSystem.AddFile(service.HostsFilePath, new MockFileData(content)); var data = await service.ReadAsync(); @@ -91,8 +91,7 @@ namespace Hosts.Tests "; var fileSystem = new CustomMockFileSystem(); - var userSettings = new Mock(); - var service = new HostsService(fileSystem, userSettings.Object, _elevationHelper.Object); + var service = new HostsService(fileSystem, _userSettings.Object, _elevationHelper.Object); fileSystem.AddFile(service.HostsFilePath, new MockFileData(content)); var data = await service.ReadAsync(); @@ -118,8 +117,7 @@ namespace Hosts.Tests "; var fileSystem = new CustomMockFileSystem(); - var userSettings = new Mock(); - var service = new HostsService(fileSystem, userSettings.Object, _elevationHelper.Object); + var service = new HostsService(fileSystem, _userSettings.Object, _elevationHelper.Object); fileSystem.AddFile(service.HostsFilePath, new MockFileData(content)); var data = await service.ReadAsync(); @@ -138,9 +136,7 @@ namespace Hosts.Tests public async Task Empty_Hosts() { var fileSystem = new CustomMockFileSystem(); - var userSettings = new Mock(); - - var service = new HostsService(fileSystem, userSettings.Object, _elevationHelper.Object); + var service = new HostsService(fileSystem, _userSettings.Object, _elevationHelper.Object); fileSystem.AddFile(service.HostsFilePath, new MockFileData(string.Empty)); await service.WriteAsync(string.Empty, Enumerable.Empty()); @@ -203,7 +199,6 @@ namespace Hosts.Tests var fileSystem = new CustomMockFileSystem(); var userSettings = new Mock(); userSettings.Setup(m => m.AdditionalLinesPosition).Returns(HostsAdditionalLinesPosition.Bottom); - var service = new HostsService(fileSystem, userSettings.Object, _elevationHelper.Object); fileSystem.AddFile(service.HostsFilePath, new MockFileData(content)); @@ -228,8 +223,7 @@ namespace Hosts.Tests "; var fileSystem = new CustomMockFileSystem(); - var userSettings = new Mock(); - var service = new HostsService(fileSystem, userSettings.Object, _elevationHelper.Object); + var service = new HostsService(fileSystem, _userSettings.Object, _elevationHelper.Object); fileSystem.AddFile(service.HostsFilePath, new MockFileData(content)); var data = await service.ReadAsync(); @@ -243,12 +237,37 @@ namespace Hosts.Tests public async Task Save_NotRunningElevatedException() { var fileSystem = new CustomMockFileSystem(); - var userSettings = new Mock(); var elevationHelper = new Mock(); elevationHelper.Setup(m => m.IsElevated).Returns(false); - var service = new HostsService(fileSystem, userSettings.Object, elevationHelper.Object); + var service = new HostsService(fileSystem, _userSettings.Object, elevationHelper.Object); await Assert.ThrowsExceptionAsync(async () => await service.WriteAsync("# Empty hosts file", Enumerable.Empty())); } + + [TestMethod] + public async Task Save_ReadOnlyHostsException() + { + var fileSystem = new CustomMockFileSystem(); + var service = new HostsService(fileSystem, _userSettings.Object, _elevationHelper.Object); + var hostsFile = new MockFileData(string.Empty); + hostsFile.Attributes = System.IO.FileAttributes.ReadOnly; + fileSystem.AddFile(service.HostsFilePath, hostsFile); + + await Assert.ThrowsExceptionAsync(async () => await service.WriteAsync("# Empty hosts file", Enumerable.Empty())); + } + + [TestMethod] + public void Remove_ReadOnly() + { + var fileSystem = new CustomMockFileSystem(); + var service = new HostsService(fileSystem, _userSettings.Object, _elevationHelper.Object); + var hostsFile = new MockFileData(string.Empty); + hostsFile.Attributes = System.IO.FileAttributes.ReadOnly; + fileSystem.AddFile(service.HostsFilePath, hostsFile); + + service.RemoveReadOnly(); + var readOnly = fileSystem.FileInfo.FromFileName(service.HostsFilePath).Attributes.HasFlag(System.IO.FileAttributes.ReadOnly); + Assert.IsFalse(readOnly); + } } } diff --git a/src/modules/Hosts/Hosts/Helpers/NotRunningElevatedException.cs b/src/modules/Hosts/Hosts/Exceptions/NotRunningElevatedException.cs similarity index 91% rename from src/modules/Hosts/Hosts/Helpers/NotRunningElevatedException.cs rename to src/modules/Hosts/Hosts/Exceptions/NotRunningElevatedException.cs index 54d2aee710..4aa428a270 100644 --- a/src/modules/Hosts/Hosts/Helpers/NotRunningElevatedException.cs +++ b/src/modules/Hosts/Hosts/Exceptions/NotRunningElevatedException.cs @@ -4,7 +4,7 @@ using System; -namespace Hosts.Helpers +namespace Hosts.Exceptions { public class NotRunningElevatedException : Exception { diff --git a/src/modules/Hosts/Hosts/Exceptions/ReadOnlyHostsException.cs b/src/modules/Hosts/Hosts/Exceptions/ReadOnlyHostsException.cs new file mode 100644 index 0000000000..76685aac4a --- /dev/null +++ b/src/modules/Hosts/Hosts/Exceptions/ReadOnlyHostsException.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Hosts.Exceptions +{ + public class ReadOnlyHostsException : Exception + { + } +} diff --git a/src/modules/Hosts/Hosts/Helpers/HostsService.cs b/src/modules/Hosts/Hosts/Helpers/HostsService.cs index c6eaada406..ec58c149de 100644 --- a/src/modules/Hosts/Hosts/Helpers/HostsService.cs +++ b/src/modules/Hosts/Hosts/Helpers/HostsService.cs @@ -13,6 +13,7 @@ using System.Net.NetworkInformation; using System.Text; using System.Threading; using System.Threading.Tasks; +using Hosts.Exceptions; using Hosts.Models; using Hosts.Settings; using ManagedCommon; @@ -129,6 +130,11 @@ namespace Hosts.Helpers throw new NotRunningElevatedException(); } + if (_fileSystem.FileInfo.FromFileName(HostsFilePath).IsReadOnly) + { + throw new ReadOnlyHostsException(); + } + var lines = new List(); if (entries.Any()) @@ -288,6 +294,15 @@ namespace Hosts.Helpers } } + public void RemoveReadOnly() + { + var fileInfo = _fileSystem.FileInfo.FromFileName(HostsFilePath); + if (fileInfo.IsReadOnly) + { + fileInfo.IsReadOnly = false; + } + } + public void Dispose() { Dispose(disposing: true); diff --git a/src/modules/Hosts/Hosts/Helpers/IHostsService.cs b/src/modules/Hosts/Hosts/Helpers/IHostsService.cs index b9a14d1de8..cf35db07a1 100644 --- a/src/modules/Hosts/Hosts/Helpers/IHostsService.cs +++ b/src/modules/Hosts/Hosts/Helpers/IHostsService.cs @@ -24,5 +24,7 @@ namespace Hosts.Helpers void CleanupBackup(); void OpenHostsFile(); + + void RemoveReadOnly(); } } diff --git a/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml b/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml index 2486b708c0..27ddd09a71 100644 --- a/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml +++ b/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml @@ -377,7 +377,15 @@ IsOpen="{x:Bind ViewModel.Error, Mode=TwoWay}" Message="{x:Bind ViewModel.ErrorMessage, Mode=TwoWay}" Severity="Error" - Visibility="{x:Bind ViewModel.Error, Mode=TwoWay, Converter={StaticResource BoolToVisibilityConverter}}" /> + Visibility="{x:Bind ViewModel.Error, Mode=TwoWay, Converter={StaticResource BoolToVisibilityConverter}}"> + +