mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
Upgrade to check-spelling v0.0.24 (#36235)
This upgrades to [v0.0.24](https://github.com/check-spelling/check-spelling/releases/tag/v0.0.24). A number of GitHub APIs are being turned off shortly, so you need to upgrade or various uncertain outcomes will occur. There's a new accessibility forbidden pattern: > Do not use `(click) here` links > For more information, see: > * https://www.w3.org/QA/Tips/noClickHere > * https://webaim.org/techniques/hypertext/link_text > * https://granicus.com/blog/why-click-here-links-are-bad/ > * https://heyoka.medium.com/dont-use-click-here-f32f445d1021 ```pl (?i)(?:>|\[)(?:(?:click |)here|link|(?:read |)more)(?:</|\]\() ``` There are some minor bugs that I'm aware of and which I've fixed since this release, but I don't expect to make another release this month. I've added a pair of patterns for includes and pragmas. My argument is that the **compiler** will _generally_ tell you if you've misspelled an include and the **linker** will _generally_ tell you if you misspell a lib. - There's a caveat here: If your include case-insensitively matches the referenced file (but doesn't properly match it), then unless you either use a case-sensitive file system (as opposed to case-preserving) or beg clang to warn, you won't notice when you make this specific mistake -- this matters in that a couple of Windows headers (e.g. Unknwn.h) have particular case and repositories don't tend to consistently/properly write them.
This commit is contained in:
@@ -15,7 +15,7 @@ using Stopwatch = Wox.Infrastructure.Stopwatch;
|
||||
namespace PowerLauncher.Helper
|
||||
{
|
||||
/// <Note>
|
||||
/// On Windows operating system the name of environment variables is case insensitive. This means if we have a user and machine variable with differences in their name casing (eg. test vs Test), the name casing from machine level is used and won't be overwritten by the user var.
|
||||
/// On Windows operating system the name of environment variables is case-insensitive. This means if we have a user and machine variable with differences in their name casing (eg. test vs Test), the name casing from machine level is used and won't be overwritten by the user var.
|
||||
/// Example for Window's behavior: test=ValueMachine (Machine level) + TEST=ValueUser (User level) => test=ValueUser (merged)
|
||||
/// To get the same behavior we use "StringComparer.OrdinalIgnoreCase" as compare property for the HashSet and Dictionaries where we merge machine and user variable names.
|
||||
/// </Note>
|
||||
@@ -96,7 +96,7 @@ namespace PowerLauncher.Helper
|
||||
// Determine deleted variables and add them with a "string.Empty" value as marker to the dictionary
|
||||
foreach (DictionaryEntry pVar in oldProcessEnvironment)
|
||||
{
|
||||
// We must compare case insensitive (see dictionary assignment) to avoid false positives when the variable name has changed (Example: "path" -> "Path")
|
||||
// We must compare case-insensitive (see dictionary assignment) to avoid false positives when the variable name has changed (Example: "path" -> "Path")
|
||||
if (!newEnvironment.ContainsKey((string)pVar.Key) & !_protectedProcessVariables.Contains((string)pVar.Key))
|
||||
{
|
||||
newEnvironment.Add((string)pVar.Key, string.Empty);
|
||||
@@ -107,7 +107,7 @@ namespace PowerLauncher.Helper
|
||||
// Later we only like to recreate the changed ones
|
||||
foreach (string varName in newEnvironment.Keys.ToList())
|
||||
{
|
||||
// To be able to detect changed names correctly we have to compare case sensitive
|
||||
// To be able to detect changed names correctly we have to compare case-sensitive
|
||||
if (oldProcessEnvironment.Contains(varName))
|
||||
{
|
||||
if (oldProcessEnvironment[varName].Equals(newEnvironment[varName]))
|
||||
@@ -155,7 +155,7 @@ namespace PowerLauncher.Helper
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// The dotnet method "System.Environment.SetEnvironmentVariable" has it's own internal method to check the input parameters. Here we catch the exceptions that we don't check before updating the environment variable and log it to avoid crashes of PT Run.
|
||||
// The dotnet method "System.Environment.SetEnvironmentVariable" has its own internal method to check the input parameters. Here we catch the exceptions that we don't check before updating the environment variable and log it to avoid crashes of PT Run.
|
||||
Log.Exception($"Unhandled exception while updating the environment variable [{kv.Key}] for the PT Run process. (The variable value has a length of [{varValueLength}].)", ex, typeof(PowerLauncher.Helper.EnvironmentHelper));
|
||||
}
|
||||
}
|
||||
@@ -189,7 +189,7 @@ namespace PowerLauncher.Helper
|
||||
string uVarKey = (string)uVar.Key;
|
||||
string uVarValue = (string)uVar.Value;
|
||||
|
||||
// The variable name of the path variable can be upper case, lower case ore mixed case. So we have to compare case insensitive.
|
||||
// The variable name of the path variable can be upper case, lower case ore mixed case. So we have to compare case-insensitive.
|
||||
if (!uVarKey.Equals(PathVariableName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
environment[uVarKey] = uVarValue;
|
||||
|
||||
Reference in New Issue
Block a user