mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
Updates for check-spelling v0.0.25 (#40386)
## Summary of the Pull Request - #39572 updated check-spelling but ignored: > 🐣 Breaking Changes [Code Scanning action requires a Code Scanning Ruleset](https://github.com/check-spelling/check-spelling/wiki/Breaking-Change:-Code-Scanning-action-requires-a-Code-Scanning-Ruleset) If you use SARIF reporting, then instead of the workflow yielding an ❌ when it fails, it will rely on [github-advanced-security 🤖](https://github.com/apps/github-advanced-security) to report the failure. You will need to adjust your checks for PRs. This means that check-spelling hasn't been properly doing its job 😦. I'm sorry, I should have pushed a thing to this repo earlier,... Anyway, as with most refreshes, this comes with a number of fixes, some are fixes for typos that snuck in before the 0.0.25 upgrade, some are for things that snuck in after, some are based on new rules in spell-check-this, and some are hand written patterns based on running through this repository a few times. About the 🐣 **breaking change**: someone needs to create a ruleset for this repository (see [Code Scanning action requires a Code Scanning Ruleset: Sample ruleset ](https://github.com/check-spelling/check-spelling/wiki/Breaking-Change:-Code-Scanning-action-requires-a-Code-Scanning-Ruleset#sample-ruleset)). The alternative to adding a ruleset is to change the condition to not use sarif for this repository. In general, I think the github integration from sarif is prettier/more helpful, so I think that it's the better choice. You can see an example of it working in: - https://github.com/check-spelling-sandbox/PowerToys/pull/23 --------- Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Dustin L. Howett <dustin@howett.net>
This commit is contained in:
@@ -44,7 +44,7 @@ namespace Community.PowerToys.Run.Plugin.UnitConverter
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces a split input array with shorthand feet/inch notation (1', 1'2" etc) to 'x foot in cm'.
|
||||
/// Replaces a split input array with shorthand feet/inch notation (1', 1'2", etc.) to 'x foot in cm'.
|
||||
/// </summary>
|
||||
public static void ShorthandFeetInchHandler(ref string[] split, CultureInfo culture)
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace Microsoft.Plugin.Folder.Sources
|
||||
|
||||
if (isRecursive)
|
||||
{
|
||||
// match everything before and after search term using supported wildcard '*', ie. *searchterm*
|
||||
// match everything before and after search term using supported wildcard '*', i.e. *searchterm*
|
||||
if (string.IsNullOrEmpty(incompleteName))
|
||||
{
|
||||
incompleteName = "*";
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Microsoft.Plugin.Indexer.DriveDetection
|
||||
{
|
||||
public class RegistryWrapper : IRegistryWrapper
|
||||
{
|
||||
// Given the registrypath and the name of the value, to retrieve the data corresponding to that registry key
|
||||
// Given the registry path and the name of the value, to retrieve the data corresponding to that registry key
|
||||
public int GetHKLMRegistryValue(string registryLocation, string valueName)
|
||||
{
|
||||
using (RegistryKey regKey = Registry.LocalMachine.OpenSubKey(registryLocation))
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Microsoft.Plugin.Program.Logger
|
||||
internal static class ProgramLogger
|
||||
{
|
||||
/// <summary>
|
||||
/// Logs an warning
|
||||
/// Logs a warning
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
internal static void Warn(string message, Exception ex, Type fullClassName, string loadingProgramPath, [CallerMemberName] string methodName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
},
|
||||
};
|
||||
|
||||
// To set the title to always be the displayname of the packaged application
|
||||
// To set the title to always be the display name of the packaged application
|
||||
result.Title = DisplayName;
|
||||
result.TitleHighlightData = StringMatcher.FuzzySearch(query, Name).MatchData;
|
||||
|
||||
@@ -596,7 +596,7 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
}
|
||||
else
|
||||
{
|
||||
// for C:\Windows\MiracastView etc
|
||||
// for C:\Windows\MiracastView, etc.
|
||||
path = Path.Combine(Package.Location, "Assets", uri);
|
||||
}
|
||||
|
||||
|
||||
@@ -991,7 +991,7 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
var paths = new HashSet<string>(defaultHashsetSize);
|
||||
var runCommandPaths = new HashSet<string>(defaultHashsetSize);
|
||||
|
||||
// Parallelize multiple sources, and priority based on paths which most likely contain .lnks which are formatted
|
||||
// Parallelize multiple sources, and priority based on paths which most likely contain .lnk files which are formatted
|
||||
var sources = new (bool IsEnabled, Func<IEnumerable<string>> GetPaths)[]
|
||||
{
|
||||
(true, () => CustomProgramPaths(settings.ProgramSources, settings.ProgramSuffixes)),
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Microsoft.Plugin.Program.Storage
|
||||
|
||||
// InitializeAppInfo will throw if there is no AppxManifest.xml for the package.
|
||||
// Note there are sometimes multiple packages per product and this doesn't necessarily mean that we haven't found the app.
|
||||
// eg. "Could not find file 'C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminalPreview_2020.616.45.0_neutral_~_8wekyb3d8bbwe\\AppxManifest.xml'."
|
||||
// e.g. "Could not find file 'C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminalPreview_2020.616.45.0_neutral_~_8wekyb3d8bbwe\\AppxManifest.xml'."
|
||||
catch (System.IO.FileNotFoundException e)
|
||||
{
|
||||
ProgramLogger.Exception(e.Message, e, GetType(), package.InstalledLocation.ToString());
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Microsoft.Plugin.Program.Storage
|
||||
|
||||
// fix for https://github.com/microsoft/PowerToys/issues/34391
|
||||
// the msi installer creates a shortcut, which is detected by the PT Run and ends up in calling this OnAppRenamed method
|
||||
// the thread needs to be halted for a short time to avoid locking the new shortcut file as we read it, otherwise the lock causes
|
||||
// the thread needs to be halted for a short time to avoid locking the new shortcut file as we read it; otherwise, the lock causes
|
||||
// in the issue scenario that a warning is popping up during the msi install process.
|
||||
await Task.Delay(OnRenamedEventWaitTime).ConfigureAwait(false);
|
||||
|
||||
@@ -203,12 +203,12 @@ namespace Microsoft.Plugin.Program.Storage
|
||||
}
|
||||
|
||||
// When a URL application is deleted, we can no longer get the HashCode directly from the path because the FullPath a Url app is the URL obtained from reading the file
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1309:Use ordinal string comparison", Justification = "Using CurrentCultureIgnoreCase since application names could be dependent on currentculture See: https://github.com/microsoft/PowerToys/pull/5847/files#r468245190")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1309:Use ordinal string comparison", Justification = "Using CurrentCultureIgnoreCase since application names could be dependent on current culture See: https://github.com/microsoft/PowerToys/pull/5847/files#r468245190")]
|
||||
private Win32Program GetAppWithSameNameAndExecutable(string name, string executableName)
|
||||
{
|
||||
foreach (Win32Program app in Items)
|
||||
{
|
||||
// Using CurrentCultureIgnoreCase since application names could be dependent on currentculture See: https://github.com/microsoft/PowerToys/pull/5847/files#r468245190
|
||||
// Using CurrentCultureIgnoreCase since application names could be dependent on current culture See: https://github.com/microsoft/PowerToys/pull/5847/files#r468245190
|
||||
if (name.Equals(app.Name, StringComparison.CurrentCultureIgnoreCase) && executableName.Equals(app.ExecutableName, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
return app;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Microsoft.Plugin.Shell
|
||||
string cmd = query.Search;
|
||||
if (string.IsNullOrEmpty(cmd))
|
||||
{
|
||||
return ResultsFromlHistory();
|
||||
return ResultsFromHistory();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -169,7 +169,7 @@ namespace Microsoft.Plugin.Shell
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<Result> ResultsFromlHistory()
|
||||
private List<Result> ResultsFromHistory()
|
||||
{
|
||||
IEnumerable<Result> history = _settings.Count.OrderByDescending(o => o.Value)
|
||||
.Select(m => new Result
|
||||
@@ -446,7 +446,7 @@ namespace Microsoft.Plugin.Shell
|
||||
|
||||
public List<ContextMenuResult> LoadContextMenus(Result selectedResult)
|
||||
{
|
||||
var resultlist = new List<ContextMenuResult>
|
||||
var resultList = new List<ContextMenuResult>
|
||||
{
|
||||
new ContextMenuResult
|
||||
{
|
||||
@@ -478,7 +478,7 @@ namespace Microsoft.Plugin.Shell
|
||||
},
|
||||
};
|
||||
|
||||
return resultlist;
|
||||
return resultList;
|
||||
}
|
||||
|
||||
public void UpdateSettings(PowerLauncherPluginSettings settings)
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
/// Method to initiate killing the process of a window
|
||||
/// </summary>
|
||||
/// <param name="window">Window data</param>
|
||||
/// <returns>True if the PT Run window should close, otherwise false.</returns>
|
||||
/// <returns>True if the PT Run window should close; otherwise, false.</returns>
|
||||
private static bool KillProcessCommand(Window window)
|
||||
{
|
||||
// Validate process
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
text = text.ToLower(CultureInfo.CurrentCulture);
|
||||
|
||||
// Create a grid to march matches like
|
||||
// eg.
|
||||
// e.g.
|
||||
// a b c a d e c f g
|
||||
// a x x
|
||||
// c x x
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
/// <summary>
|
||||
/// A class to represent a search string
|
||||
/// </summary>
|
||||
/// <remarks>Class was added inorder to be able to attach various context data to
|
||||
/// <remarks>Class was added in order to be able to attach various context data to
|
||||
/// a search string</remarks>
|
||||
internal class SearchString
|
||||
{
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
{
|
||||
if (!NativeMethods.ShowWindow(Hwnd, ShowWindowCommand.Restore))
|
||||
{
|
||||
// ShowWindow doesn't work if the process is running elevated: fallback to SendMessage
|
||||
// ShowWindow doesn't work if the process is running elevated: fall back to SendMessage
|
||||
_ = NativeMethods.SendMessage(Hwnd, Win32Constants.WM_SYSCOMMAND, Win32Constants.SC_RESTORE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator
|
||||
private static string CheckScientificNotation(string input)
|
||||
{
|
||||
/**
|
||||
* NOTE: By the time the expression gets to us, it's already in English format.
|
||||
* NOTE: By the time that the expression gets to us, it's already in English format.
|
||||
*
|
||||
* Regex explanation:
|
||||
* (-?(\d+({0}\d*)?)|-?({0}\d+)): Used to capture one of two types:
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Microsoft.PowerToys.Run.Plugin.OneNote
|
||||
return new List<Result>(0);
|
||||
}
|
||||
|
||||
// If there's cached results for this query, return immediately, otherwise wait for delayedExecution.
|
||||
// If there's cached results for this query, return immediately; otherwise, wait for delayedExecution.
|
||||
var results = _cache.Get<List<Result>>(query.Search);
|
||||
return results ?? Query(query, false);
|
||||
}
|
||||
@@ -121,7 +121,7 @@ namespace Microsoft.PowerToys.Run.Plugin.OneNote
|
||||
return new List<Result>(0);
|
||||
}
|
||||
|
||||
// Get results from cache if they already exist for this query, otherwise query OneNote. Results will be cached for 1 day.
|
||||
// Get results from cache if they already exist for this query; otherwise, query OneNote. Results will be cached for 1 day.
|
||||
var results = _cache.GetOrAdd(query.Search, () =>
|
||||
{
|
||||
var pages = OneNoteProvider.FindPages(query.Search);
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.UnitTest.Helper
|
||||
[TestMethod]
|
||||
public void GetRegistryBaseKeyTestMoreThanOneBaseKey()
|
||||
{
|
||||
var (baseKeyList, _) = RegistryHelper.GetRegistryBaseKey("HKC\\Control Panel\\Accessibility"); /* #no-spell-check-line */
|
||||
var (baseKeyList, _) = RegistryHelper.GetRegistryBaseKey("HKC\\Control Panel\\Accessibility");
|
||||
|
||||
Assert.IsNotNull(baseKeyList);
|
||||
Assert.IsTrue(baseKeyList.Count() > 1);
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.Helper
|
||||
/// Open the Windows registry editor and jump to registry key inside the given key (inside the <see cref="RegistryEntry"/>
|
||||
/// </summary>
|
||||
/// <param name="entry">The <see cref="RegistryEntry"/> to jump in</param>
|
||||
/// <returns><see langword="true"/> if the registry editor was successful open, otherwise <see langword="false"/></returns>
|
||||
/// <returns><see langword="true"/> if the registry editor was successful open; otherwise, <see langword="false"/></returns>
|
||||
internal static bool TryToOpenInRegistryEditor(in RegistryEntry entry)
|
||||
{
|
||||
try
|
||||
@@ -119,7 +119,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.Helper
|
||||
/// Copy the given text to the clipboard
|
||||
/// </summary>
|
||||
/// <param name="text">The text to copy to the clipboard</param>
|
||||
/// <returns><see langword="true"/>The text successful copy to the clipboard, otherwise <see langword="false"/></returns>
|
||||
/// <returns><see langword="true"/>The text successful copy to the clipboard; otherwise, <see langword="false"/></returns>
|
||||
private static bool TryToCopyToClipBoard(in string text)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.Helper
|
||||
/// <param name="query">The query that could contain parts</param>
|
||||
/// <param name="queryKey">The key part of the query</param>
|
||||
/// <param name="queryValueName">The value name part of the query</param>
|
||||
/// <returns><see langword="true"/> when the query search for a key and a value name, otherwise <see langword="false"/></returns>
|
||||
/// <returns><see langword="true"/> when the query search for a key and a value name; otherwise, <see langword="false"/></returns>
|
||||
internal static bool GetQueryParts(in string query, out string queryKey, out string queryValueName)
|
||||
{
|
||||
var sanitizedQuery = SanitizeQuery(query);
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Components
|
||||
/// Copy the given text to the clipboard
|
||||
/// </summary>
|
||||
/// <param name="text">The text to copy to the clipboard</param>
|
||||
/// <returns><see langword="true"/>The text successful copy to the clipboard, otherwise <see langword="false"/></returns>
|
||||
/// <returns><see langword="true"/>The text successful copy to the clipboard; otherwise, <see langword="false"/></returns>
|
||||
/// <remarks>Code copied from TimeZone plugin</remarks>
|
||||
internal static bool CopyToClipBoard(in string text)
|
||||
{
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Components
|
||||
/// <param name="input">String with date/time</param>
|
||||
/// <param name="timestamp">The new <see cref="DateTime"/> object</param>
|
||||
/// <param name="inputParsingErrorMsg">Error message shown to the user</param>
|
||||
/// <returns>True on success, otherwise false</returns>
|
||||
/// <returns>True on success; otherwise, false</returns>
|
||||
internal static bool ParseStringAsDateTime(in string input, out DateTime timestamp, out string inputParsingErrorMsg)
|
||||
{
|
||||
inputParsingErrorMsg = string.Empty;
|
||||
@@ -294,7 +294,7 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Components
|
||||
/// Test if input is special parsing for Unix time, Unix time in milliseconds, file time, ...
|
||||
/// </summary>
|
||||
/// <param name="input">String with date/time</param>
|
||||
/// <returns>True if yes, otherwise false</returns>
|
||||
/// <returns>True if yes; otherwise, false</returns>
|
||||
internal static bool IsSpecialInputParsing(string input)
|
||||
{
|
||||
return _regexSpecialInputFormats.IsMatch(input);
|
||||
|
||||
@@ -466,7 +466,7 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to for; and; nor; but; or; so.
|
||||
/// Looks up a localized string similar to "for; and; nor; but; or; so".
|
||||
/// </summary>
|
||||
internal static string Microsoft_plugin_timedate_Search_ConjunctionList {
|
||||
get {
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsSettings.Helper
|
||||
/// Copy the given text to the clipboard
|
||||
/// </summary>
|
||||
/// <param name="text">The text to copy to the clipboard</param>
|
||||
/// <returns><see langword="true"/>The text successful copy to the clipboard, otherwise <see langword="false"/></returns>
|
||||
/// <returns><see langword="true"/>The text successful copy to the clipboard; otherwise, <see langword="false"/></returns>
|
||||
private static bool TryToCopyToClipBoard(in string text)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsSettings.Helper
|
||||
/// Open the settings page of the given <see cref="IWindowsSetting"/>.
|
||||
/// </summary>
|
||||
/// <param name="entry">The <see cref="WindowsSetting"/> that contain the information to open the setting on command level.</param>
|
||||
/// <returns><see langword="true"/> if the settings could be opened, otherwise <see langword="false"/>.</returns>
|
||||
/// <returns><see langword="true"/> if the settings could be opened; otherwise, <see langword="false"/>.</returns>
|
||||
private static bool DoOpenSettingsAction(WindowsSetting entry)
|
||||
{
|
||||
ProcessStartInfo processStartInfo;
|
||||
|
||||
Reference in New Issue
Block a user