From 924906ae76d9de9f48e81d462204fbd90955bab9 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Fri, 25 Mar 2022 12:11:37 -0500 Subject: [PATCH 01/30] It works? --- .../TerminalSettingsEditor/ColorSchemes.cpp | 18 +--- .../TerminalSettingsModel/CascadiaSettings.h | 3 + .../CascadiaSettingsSerialization.cpp | 86 ++++++++++++++++--- .../TerminalSettingsModel/ColorScheme.cpp | 12 ++- .../TerminalSettingsModel/ColorScheme.h | 3 + .../TerminalSettingsModel/ColorScheme.idl | 4 +- .../GlobalAppSettings.cpp | 7 -- .../ISettingsModelObject.idl | 20 +++++ ...crosoft.Terminal.Settings.ModelLib.vcxproj | 1 + .../TerminalSettingsModel/Profile.idl | 15 +--- 10 files changed, 118 insertions(+), 51 deletions(-) create mode 100644 src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp b/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp index 4d2220b3eb2..6dd7110c557 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp @@ -54,18 +54,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation RS_(L"ColorScheme_BrightWhite/Header") }; - static const std::array InBoxSchemes = { - L"Campbell", - L"Campbell Powershell", - L"Vintage", - L"One Half Dark", - L"One Half Light", - L"Solarized Dark", - L"Solarized Light", - L"Tango Dark", - L"Tango Light" - }; - ColorSchemes::ColorSchemes() : _ColorSchemeList{ single_threaded_observable_vector() }, _CurrentNonBrightColorTable{ single_threaded_observable_vector() }, @@ -183,8 +171,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation // Set the text disclaimer for the text box hstring disclaimer{}; - const std::wstring schemeName{ colorScheme.Name() }; - if (std::find(std::begin(InBoxSchemes), std::end(InBoxSchemes), schemeName) != std::end(InBoxSchemes)) + if (colorScheme.Origin() != Model::OriginTag::User) { // load disclaimer for in-box profiles disclaimer = RS_(L"ColorScheme_DeleteButtonDisclaimerInBox"); @@ -275,8 +262,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation if (const auto& scheme{ CurrentColorScheme() }) { // Only allow this color scheme to be deleted if it's not provided in-box - const std::wstring myName{ scheme.Name() }; - return std::find(std::begin(InBoxSchemes), std::end(InBoxSchemes), myName) == std::end(InBoxSchemes); + return scheme.Origin() == Model::OriginTag::User; } return false; } diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettings.h b/src/cascadia/TerminalSettingsModel/CascadiaSettings.h index daa724a0f4c..0eb2cf0964f 100644 --- a/src/cascadia/TerminalSettingsModel/CascadiaSettings.h +++ b/src/cascadia/TerminalSettingsModel/CascadiaSettings.h @@ -44,6 +44,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation winrt::com_ptr baseLayerProfile; std::vector> profiles; std::unordered_map> profilesByGuid; + std::unordered_map> colorSchemes; + std::unordered_map colorSchemeRemappings; void clear(); }; @@ -86,6 +88,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation static winrt::com_ptr _parseProfile(const OriginTag origin, const winrt::hstring& source, const Json::Value& profileJson); void _appendProfile(winrt::com_ptr&& profile, const winrt::guid& guid, ParsedSettings& settings); void _addUserProfileParent(const winrt::com_ptr& profile); + void _addOrMergeUserColorScheme(const winrt::com_ptr& colorScheme); void _executeGenerator(const IDynamicProfileGenerator& generator); std::unordered_set _ignoredNamespaces; diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp index 7cce19fe736..d055a50b621 100644 --- a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp +++ b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp @@ -87,6 +87,7 @@ void ParsedSettings::clear() baseLayerProfile = {}; profiles.clear(); profilesByGuid.clear(); + colorSchemes.clear(); } // This is a convenience method used by the CascadiaSettings constructor. @@ -181,6 +182,7 @@ void SettingsLoader::ApplyRuntimeInitialSettings() // Adds profiles from .inboxSettings as parents of matching profiles in .userSettings. // That way the user profiles will get appropriate defaults from the generators (like icons and such). // If a matching profile doesn't exist yet in .userSettings, one will be created. +// Additionally, produces a final view of the color schemes from the inbox + user settings void SettingsLoader::MergeInboxIntoUserSettings() { for (const auto& profile : inboxSettings.profiles) @@ -304,6 +306,11 @@ void SettingsLoader::MergeFragmentIntoUserSettings(const winrt::hstring& source, // by MergeInboxIntoUserSettings/FindFragmentsAndMergeIntoUserSettings). void SettingsLoader::FinalizeLayering() { + for (const auto& colorScheme : inboxSettings.colorSchemes) + { + _addOrMergeUserColorScheme(colorScheme.second); + } + // Layer default globals -> user globals userSettings.globals->AddLeastImportantParent(inboxSettings.globals); userSettings.globals->_FinalizeInheritance(); @@ -524,7 +531,8 @@ void SettingsLoader::_parse(const OriginTag origin, const winrt::hstring& source { if (const auto scheme = ColorScheme::FromJson(schemeJson)) { - settings.globals->AddColorScheme(*scheme); + scheme->Origin(origin); + settings.colorSchemes.emplace(scheme->Name(), std::move(scheme)); } } } @@ -571,7 +579,8 @@ void SettingsLoader::_parseFragment(const winrt::hstring& source, const std::str { if (const auto scheme = ColorScheme::FromJson(schemeJson)) { - settings.globals->AddColorScheme(*scheme); + scheme->Origin(OriginTag::Fragment); + settings.colorSchemes.emplace(scheme->Name(), std::move(scheme)); } } CATCH_LOG() @@ -617,9 +626,9 @@ void SettingsLoader::_parseFragment(const winrt::hstring& source, const std::str } } - for (const auto& kv : settings.globals->ColorSchemes()) + for (const auto& fragmentColorScheme : settings.colorSchemes) { - userSettings.globals->AddColorScheme(kv.Value()); + _addOrMergeUserColorScheme(fragmentColorScheme.second); } } @@ -719,6 +728,27 @@ void SettingsLoader::_addUserProfileParent(const winrt::com_ptr& newScheme) +{ + if (const auto [it, inserted] = userSettings.colorSchemes.emplace(newScheme->Name(), newScheme); !inserted) + { + // This scheme was not inserted because one already existed. + auto existingScheme{ it->second }; + if (existingScheme->Origin() == OriginTag::User) // we only want to impose ordering on User schemes + { + it->second = newScheme; // Stomp the user's existing scheme with the one we just got (to make sure the right Origin is set) + if (!existingScheme->IsEquivalentForSettingsMergePurposes(newScheme)) + { + // Rename the user's scheme. + existingScheme->Name(hstring{ fmt::format(L"{} (Modified)", existingScheme->Name()) }); + userSettings.colorSchemeRemappings.emplace(newScheme->Name(), existingScheme->Name()); + // And re-add it to the end. + userSettings.colorSchemes.emplace(existingScheme->Name(), std::move(existingScheme)); + } + } + } +} + // As the name implies it executes a generator. // Generated profiles are added to .inboxSettings. Used by GenerateProfiles(). void SettingsLoader::_executeGenerator(const IDynamicProfileGenerator& generator) @@ -889,6 +919,39 @@ CascadiaSettings::CascadiaSettings(SettingsLoader&& loader) : allProfiles.reserve(loader.userSettings.profiles.size()); activeProfiles.reserve(loader.userSettings.profiles.size()); + auto remapColorSchemesForProfile{ [&](const winrt::com_ptr& profile) { + if (auto schemeName{ profile->DefaultAppearance().ColorSchemeName() }; !schemeName.empty()) + { + if (auto found{ loader.userSettings.colorSchemeRemappings.find(schemeName) }; found != loader.userSettings.colorSchemeRemappings.end()) + { + profile->DefaultAppearance().ColorSchemeName(found->second); + } + } + + if (auto unfocusedAppearance{ profile->UnfocusedAppearance() }) + { + if (auto schemeName{ unfocusedAppearance.ColorSchemeName() }; !schemeName.empty()) + { + if (auto found{ loader.userSettings.colorSchemeRemappings.find(schemeName) }; found != loader.userSettings.colorSchemeRemappings.end()) + { + unfocusedAppearance.ColorSchemeName(found->second); + } + } + } + } }; + + for (const auto& colorScheme : loader.userSettings.colorSchemes) + { + loader.userSettings.globals->AddColorScheme(*colorScheme.second); + } + + // SettingsLoader and ParsedSettings are supposed to always + // create these two members. We don't want null-pointer exceptions. + assert(loader.userSettings.globals != nullptr); + assert(loader.userSettings.baseLayerProfile != nullptr); + + remapColorSchemesForProfile(loader.userSettings.baseLayerProfile); + for (const auto& profile : loader.userSettings.profiles) { // If a generator stops producing a certain profile (e.g. WSL or PowerShell were removed) or @@ -905,6 +968,8 @@ CascadiaSettings::CascadiaSettings(SettingsLoader&& loader) : } } + remapColorSchemesForProfile(profile); + allProfiles.emplace_back(*profile); if (!profile->Hidden()) { @@ -926,11 +991,6 @@ CascadiaSettings::CascadiaSettings(SettingsLoader&& loader) : warnings.emplace_back(Model::SettingsLoadWarnings::DuplicateProfile); } - // SettingsLoader and ParsedSettings are supposed to always - // create these two members. We don't want null-pointer exceptions. - assert(loader.userSettings.globals != nullptr); - assert(loader.userSettings.baseLayerProfile != nullptr); - _globals = loader.userSettings.globals; _baseLayerProfile = loader.userSettings.baseLayerProfile; _allProfiles = winrt::single_threaded_observable_vector(std::move(allProfiles)); @@ -1044,14 +1104,14 @@ Json::Value CascadiaSettings::ToJson() const profiles[JsonKey(ProfilesListKey)] = profilesList; json[JsonKey(ProfilesKey)] = profiles; - // TODO GH#8100: - // "schemes" will be an accumulation of _all_ the color schemes - // including all of the ones from defaults.json Json::Value schemes{ Json::ValueType::arrayValue }; for (const auto& entry : _globals->ColorSchemes()) { const auto scheme{ winrt::get_self(entry.Value()) }; - schemes.append(scheme->ToJson()); + if (scheme->Origin() == OriginTag::User) + { + schemes.append(scheme->ToJson()); + } } json[JsonKey(SchemesKey)] = schemes; diff --git a/src/cascadia/TerminalSettingsModel/ColorScheme.cpp b/src/cascadia/TerminalSettingsModel/ColorScheme.cpp index 0d55c405b79..b57d427ebec 100644 --- a/src/cascadia/TerminalSettingsModel/ColorScheme.cpp +++ b/src/cascadia/TerminalSettingsModel/ColorScheme.cpp @@ -46,7 +46,8 @@ ColorScheme::ColorScheme() noexcept : } ColorScheme::ColorScheme(const winrt::hstring& name) noexcept : - _Name{ name } + _Name{ name }, + _Origin{ OriginTag::User } { const auto table = Utils::CampbellColorTable(); std::copy_n(table.data(), table.size(), _table.data()); @@ -61,6 +62,7 @@ winrt::com_ptr ColorScheme::Copy() const scheme->_SelectionBackground = _SelectionBackground; scheme->_CursorColor = _CursorColor; scheme->_table = _table; + scheme->_Origin = _Origin; return scheme; } @@ -174,3 +176,11 @@ winrt::Microsoft::Terminal::Core::Scheme ColorScheme::ToCoreScheme() const noexc coreScheme.BrightWhite = Table()[15]; return coreScheme; } + +bool ColorScheme::IsEquivalentForSettingsMergePurposes(const winrt::com_ptr& other) noexcept +{ + // The caller likely only got here if the names were the same, so skip checking that one. + // We do not care about the cursor color or the selection background, as the main reason we are + // doing equivalence merging is to replace old, poorly-specified versions of those two properties. + return _table == other->_table && _Background == other->_Background && _Foreground == other->_Foreground; +} diff --git a/src/cascadia/TerminalSettingsModel/ColorScheme.h b/src/cascadia/TerminalSettingsModel/ColorScheme.h index f72b7429fce..82d31cea81f 100644 --- a/src/cascadia/TerminalSettingsModel/ColorScheme.h +++ b/src/cascadia/TerminalSettingsModel/ColorScheme.h @@ -51,7 +51,10 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation com_array Table() const noexcept; void SetColorTableEntry(uint8_t index, const Core::Color& value) noexcept; + bool IsEquivalentForSettingsMergePurposes(const winrt::com_ptr& other) noexcept; + WINRT_PROPERTY(winrt::hstring, Name); + WINRT_PROPERTY(OriginTag, Origin, OriginTag::None); WINRT_PROPERTY(Core::Color, Foreground, static_cast(DEFAULT_FOREGROUND)); WINRT_PROPERTY(Core::Color, Background, static_cast(DEFAULT_BACKGROUND)); WINRT_PROPERTY(Core::Color, SelectionBackground, static_cast(DEFAULT_FOREGROUND)); diff --git a/src/cascadia/TerminalSettingsModel/ColorScheme.idl b/src/cascadia/TerminalSettingsModel/ColorScheme.idl index 8e758cfa6b2..dd55624a530 100644 --- a/src/cascadia/TerminalSettingsModel/ColorScheme.idl +++ b/src/cascadia/TerminalSettingsModel/ColorScheme.idl @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import "ISettingsModelObject.idl"; + namespace Microsoft.Terminal.Settings.Model { - [default_interface] runtimeclass ColorScheme : Windows.Foundation.IStringable { + [default_interface] runtimeclass ColorScheme : Windows.Foundation.IStringable, ISettingsModelObject { ColorScheme(); ColorScheme(String name); diff --git a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp index e417042e44e..8fb9fc3a49d 100644 --- a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp +++ b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp @@ -32,13 +32,6 @@ void GlobalAppSettings::_FinalizeInheritance() { _actionMap->AddLeastImportantParent(parent->_actionMap); _keybindingsWarnings.insert(_keybindingsWarnings.end(), parent->_keybindingsWarnings.begin(), parent->_keybindingsWarnings.end()); - for (const auto& [k, v] : parent->_colorSchemes) - { - if (!_colorSchemes.HasKey(k)) - { - _colorSchemes.Insert(k, v); - } - } } } diff --git a/src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl b/src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl new file mode 100644 index 00000000000..c271dbcd2a1 --- /dev/null +++ b/src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +namespace Microsoft.Terminal.Settings.Model +{ + // This tag is used to identify the context in which the Profile was created + enum OriginTag + { + None = 0, + User, + InBox, + Generated, + Fragment, + ProfilesDefaults + }; + + interface ISettingsModelObject { + OriginTag Origin { get; }; + } +} diff --git a/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj index 4d168b7724e..e226079d7fd 100644 --- a/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj +++ b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj @@ -184,6 +184,7 @@ + diff --git a/src/cascadia/TerminalSettingsModel/Profile.idl b/src/cascadia/TerminalSettingsModel/Profile.idl index f8f3dc8d1cd..4b320b65f63 100644 --- a/src/cascadia/TerminalSettingsModel/Profile.idl +++ b/src/cascadia/TerminalSettingsModel/Profile.idl @@ -2,6 +2,7 @@ // Licensed under the MIT license. import "IAppearanceConfig.idl"; +import "ISettingsModelObject.idl"; import "FontConfig.idl"; #include "IInheritable.idl.h" @@ -11,17 +12,6 @@ import "FontConfig.idl"; namespace Microsoft.Terminal.Settings.Model { - // This tag is used to identify the context in which the Profile was created - enum OriginTag - { - None = 0, - User, - InBox, - Generated, - Fragment, - ProfilesDefaults - }; - enum CloseOnExitMode { Never = 0, @@ -39,7 +29,7 @@ namespace Microsoft.Terminal.Settings.Model All = 0xffffffff }; - [default_interface] runtimeclass Profile : Windows.Foundation.IStringable { + [default_interface] runtimeclass Profile : Windows.Foundation.IStringable, ISettingsModelObject { Profile(); Profile(Guid guid); @@ -48,7 +38,6 @@ namespace Microsoft.Terminal.Settings.Model // True if the user explicitly removed this Profile from settings.json. Boolean Deleted { get; }; - OriginTag Origin { get; }; INHERITABLE_PROFILE_SETTING(Guid, Guid); INHERITABLE_PROFILE_SETTING(String, Name); From a31b0892dc01c61dc090e86eeebb2aa877b87777 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Sun, 24 Apr 2022 17:04:09 -0500 Subject: [PATCH 02/30] Move to FixupUserSettings, add a bunch of tests --- .../ColorSchemeTests.cpp | 519 ++++++++++++++++++ .../TerminalSettingsModel/CascadiaSettings.h | 1 + .../CascadiaSettingsSerialization.cpp | 56 +- 3 files changed, 551 insertions(+), 25 deletions(-) diff --git a/src/cascadia/LocalTests_SettingsModel/ColorSchemeTests.cpp b/src/cascadia/LocalTests_SettingsModel/ColorSchemeTests.cpp index fac134c9519..0eecb4de03a 100644 --- a/src/cascadia/LocalTests_SettingsModel/ColorSchemeTests.cpp +++ b/src/cascadia/LocalTests_SettingsModel/ColorSchemeTests.cpp @@ -10,6 +10,7 @@ using namespace Microsoft::Console; using namespace winrt::Microsoft::Terminal; +using namespace winrt::Microsoft::Terminal::Settings; using namespace winrt::Microsoft::Terminal::Settings::Model::implementation; using namespace WEX::Logging; using namespace WEX::TestExecution; @@ -38,6 +39,10 @@ namespace SettingsModelLocalTests TEST_METHOD(LayerColorSchemesOnArray); TEST_METHOD(UpdateSchemeReferences); + TEST_METHOD(LayerColorSchemesWithUserOwnedCollision); + TEST_METHOD(LayerColorSchemesWithUserOwnedCollisionRetargetsAllProfiles); + TEST_METHOD(LayerColorSchemesWithUserOwnedCollisionWithFragments); + static Core::Color rgb(uint8_t r, uint8_t g, uint8_t b) noexcept { return Core::Color{ r, g, b, 255 }; @@ -323,4 +328,518 @@ namespace SettingsModelLocalTests VERIFY_IS_TRUE(prof.DefaultAppearance().HasColorSchemeName()); } } + + void ColorSchemeTests::LayerColorSchemesWithUserOwnedCollision() + { + static constexpr std::string_view inboxSettings{ R"({ + "schemes": [ + { + "background": "#0C0C0C", + "black": "#0C0C0C", + "blue": "#0037DA", + "brightBlack": "#767676", + "brightBlue": "#3B78FF", + "brightCyan": "#61D6D6", + "brightGreen": "#16C60C", + "brightPurple": "#B4009E", + "brightRed": "#E74856", + "brightWhite": "#F2F2F2", + "brightYellow": "#F9F1A5", + "cursorColor": "#FFFFFF", + "cyan": "#3A96DD", + "foreground": "#CCCCCC", + "green": "#13A10E", + "name": "Campbell", + "purple": "#881798", + "red": "#C50F1F", + "selectionBackground": "#FFFFFF", + "white": "#CCCCCC", + "yellow": "#C19C00" + }, + { + "name": "Vintage", + "foreground": "#C0C0C0", + "background": "#000000", + "cursorColor": "#FFFFFF", + "black": "#000000", + "red": "#800000", + "green": "#008000", + "yellow": "#808000", + "blue": "#000080", + "purple": "#800080", + "cyan": "#008080", + "white": "#C0C0C0", + "brightBlack": "#808080", + "brightRed": "#FF0000", + "brightGreen": "#00FF00", + "brightYellow": "#FFFF00", + "brightBlue": "#0000FF", + "brightPurple": "#FF00FF", + "brightCyan": "#00FFFF", + "brightWhite": "#FFFFFF" + } + ] + })" }; + static constexpr std::string_view userSettings{ R"({ + "profiles": [ + { + "name" : "profile0" + } + ], + "schemes": [ + { + "background": "#121314", + "black": "#121314", + "blue": "#121314", + "brightBlack": "#121314", + "brightBlue": "#121314", + "brightCyan": "#121314", + "brightGreen": "#121314", + "brightPurple": "#121314", + "brightRed": "#121314", + "brightWhite": "#121314", + "brightYellow": "#121314", + "cursorColor": "#121314", + "cyan": "#121314", + "foreground": "#121314", + "green": "#121314", + "name": "Campbell", + "purple": "#121314", + "red": "#121314", + "selectionBackground": "#121314", + "white": "#121314", + "yellow": "#121314" + }, + { + "name": "Vintage", + "foreground": "#C0C0C0", + "background": "#000000", + "cursorColor": "#FFFFFF", + "black": "#000000", + "red": "#800000", + "green": "#008000", + "yellow": "#808000", + "blue": "#000080", + "purple": "#800080", + "cyan": "#008080", + "white": "#C0C0C0", + "brightBlack": "#808080", + "brightRed": "#FF0000", + "brightGreen": "#00FF00", + "brightYellow": "#FFFF00", + "brightBlue": "#0000FF", + "brightPurple": "#FF00FF", + "brightCyan": "#00FFFF", + "brightWhite": "#FFFFFF" + } + ] + })" }; + + // In this test, The user has a copy of Campbell which they have modified and a copy of Vintage which they + // have not. Campbell should be renamed to Campbell (Modified) and copied while Vintage should simply + // be demoted to "Inbox" status. + + const auto settings = winrt::make_self(userSettings, inboxSettings); + + const auto colorSchemes = settings->GlobalSettings().ColorSchemes(); + VERIFY_ARE_EQUAL(3u, colorSchemes.Size()); // There should be three: Campbell, Campbell Edited, Vintage + + const auto scheme0 = winrt::get_self(colorSchemes.Lookup(L"Campbell (Modified)")); + VERIFY_ARE_EQUAL(rgb(0x12, 0x13, 0x14), scheme0->Foreground()); + VERIFY_ARE_EQUAL(rgb(0x12, 0x13, 0x14), scheme0->Background()); + VERIFY_ARE_EQUAL(Model::OriginTag::User, scheme0->Origin()); + + // Stock Campbell is now untouched + const auto scheme1 = winrt::get_self(colorSchemes.Lookup(L"Campbell")); + VERIFY_ARE_EQUAL(rgb(0xcc, 0xcc, 0xcc), scheme1->Foreground()); + VERIFY_ARE_EQUAL(rgb(0x0c, 0x0c, 0x0c), scheme1->Background()); + VERIFY_ARE_EQUAL(Model::OriginTag::InBox, scheme1->Origin()); + + const auto scheme2 = winrt::get_self(colorSchemes.Lookup(L"Vintage")); + VERIFY_ARE_EQUAL(rgb(0xc0, 0xc0, 0xc0), scheme2->Foreground()); + VERIFY_ARE_EQUAL(Model::OriginTag::InBox, scheme2->Origin()); + } + + void ColorSchemeTests::LayerColorSchemesWithUserOwnedCollisionRetargetsAllProfiles() + { + static constexpr std::string_view inboxSettings{ R"({ + "schemes": [ + { + "background": "#0C0C0C", + "black": "#0C0C0C", + "blue": "#0037DA", + "brightBlack": "#767676", + "brightBlue": "#3B78FF", + "brightCyan": "#61D6D6", + "brightGreen": "#16C60C", + "brightPurple": "#B4009E", + "brightRed": "#E74856", + "brightWhite": "#F2F2F2", + "brightYellow": "#F9F1A5", + "cursorColor": "#FFFFFF", + "cyan": "#3A96DD", + "foreground": "#CCCCCC", + "green": "#13A10E", + "name": "Campbell", + "purple": "#881798", + "red": "#C50F1F", + "selectionBackground": "#FFFFFF", + "white": "#CCCCCC", + "yellow": "#C19C00" + }, + { + "name": "Vintage", + "foreground": "#C0C0C0", + "background": "#000000", + "cursorColor": "#FFFFFF", + "black": "#000000", + "red": "#800000", + "green": "#008000", + "yellow": "#808000", + "blue": "#000080", + "purple": "#800080", + "cyan": "#008080", + "white": "#C0C0C0", + "brightBlack": "#808080", + "brightRed": "#FF0000", + "brightGreen": "#00FF00", + "brightYellow": "#FFFF00", + "brightBlue": "#0000FF", + "brightPurple": "#FF00FF", + "brightCyan": "#00FFFF", + "brightWhite": "#FFFFFF" + } + ] + })" }; + static constexpr std::string_view userSettings{ R"({ + "profiles": { + "defaults": { }, // We should insert Campbell here + "list": [ + { + "name" : "profile0" // Does not specify Campbell, should not be edited! + }, + { + "name" : "profile1", + "colorScheme": "Vintage" // This should not be changed + }, + { + "name" : "profile2", + "colorScheme": "Campbell" // Direct specification should be replaced + }, + { + "name" : "profile3", + "unfocusedAppearance": { + "colorScheme": "Campbell" // Direct specification should be replaced + } + } + ], + }, + "schemes": [ + { + "background": "#121314", + "black": "#121314", + "blue": "#121314", + "brightBlack": "#121314", + "brightBlue": "#121314", + "brightCyan": "#121314", + "brightGreen": "#121314", + "brightPurple": "#121314", + "brightRed": "#121314", + "brightWhite": "#121314", + "brightYellow": "#121314", + "cursorColor": "#121314", + "cyan": "#121314", + "foreground": "#121314", + "green": "#121314", + "name": "Campbell", + "purple": "#121314", + "red": "#121314", + "selectionBackground": "#121314", + "white": "#121314", + "yellow": "#121314" + } + ] + })" }; + + // The user has a copy of Campbell that they have modified. + // Profile 0 inherited its default value from the compiled-in settings ("Campbell"), + // but through the user's perspective _they changed the values in the default scheme._ + // Therefore, we need to retarget any profile with the compiled-in defaults to the + // new copy of Campbell. + // + // Critically, we need to make sure that we do this at the lowest layer that will apply + // to the most profiles... otherwise we'll make the settings really annoying by putting + // in so many references to Campbell (Modified) + + const auto settings = winrt::make_self(userSettings, inboxSettings); + + const auto defaults{ settings->ProfileDefaults() }; + VERIFY_IS_TRUE(defaults.DefaultAppearance().HasColorSchemeName()); + VERIFY_ARE_EQUAL(L"Campbell (Modified)", defaults.DefaultAppearance().ColorSchemeName()); + + const auto& profiles{ settings->AllProfiles() }; + { + const auto& prof0{ profiles.GetAt(0) }; + VERIFY_IS_FALSE(prof0.DefaultAppearance().HasColorSchemeName()); + VERIFY_ARE_EQUAL(L"Campbell (Modified)", prof0.DefaultAppearance().ColorSchemeName()); + } + { + const auto& prof1{ profiles.GetAt(1) }; + VERIFY_IS_TRUE(prof1.DefaultAppearance().HasColorSchemeName()); + VERIFY_ARE_EQUAL(L"Vintage", prof1.DefaultAppearance().ColorSchemeName()); + } + { + const auto& prof2{ profiles.GetAt(2) }; + VERIFY_IS_TRUE(prof2.DefaultAppearance().HasColorSchemeName()); + VERIFY_ARE_EQUAL(L"Campbell (Modified)", prof2.DefaultAppearance().ColorSchemeName()); + } + { + const auto& prof3{ profiles.GetAt(3) }; + VERIFY_IS_FALSE(prof3.DefaultAppearance().HasColorSchemeName()); + VERIFY_IS_TRUE(prof3.UnfocusedAppearance().HasColorSchemeName()); + VERIFY_ARE_EQUAL(L"Campbell (Modified)", prof3.DefaultAppearance().ColorSchemeName()); + VERIFY_ARE_EQUAL(L"Campbell (Modified)", prof3.UnfocusedAppearance().ColorSchemeName()); + } + } + + void ColorSchemeTests::LayerColorSchemesWithUserOwnedCollisionWithFragments() + { + static constexpr std::string_view inboxSettings{ R"({ + "schemes": [ + { + "background": "#0C0C0C", + "black": "#0C0C0C", + "blue": "#0037DA", + "brightBlack": "#767676", + "brightBlue": "#3B78FF", + "brightCyan": "#61D6D6", + "brightGreen": "#16C60C", + "brightPurple": "#B4009E", + "brightRed": "#E74856", + "brightWhite": "#F2F2F2", + "brightYellow": "#F9F1A5", + "cursorColor": "#FFFFFF", + "cyan": "#3A96DD", + "foreground": "#CCCCCC", + "green": "#13A10E", + "name": "Campbell", + "purple": "#881798", + "red": "#C50F1F", + "selectionBackground": "#FFFFFF", + "white": "#CCCCCC", + "yellow": "#C19C00" + }, + { + "name": "Vintage", + "foreground": "#C0C0C0", + "background": "#000000", + "cursorColor": "#FFFFFF", + "black": "#000000", + "red": "#800000", + "green": "#008000", + "yellow": "#808000", + "blue": "#000080", + "purple": "#800080", + "cyan": "#008080", + "white": "#C0C0C0", + "brightBlack": "#808080", + "brightRed": "#FF0000", + "brightGreen": "#00FF00", + "brightYellow": "#FFFF00", + "brightBlue": "#0000FF", + "brightPurple": "#FF00FF", + "brightCyan": "#00FFFF", + "brightWhite": "#FFFFFF" + } + ] + })" }; + + static constexpr std::string_view fragment{ R"({ + "profiles": [ + { + "guid": "{347a67b5-b3a3-4484-9f96-a92d68f6e787}", + "name": "fragment profile 0", + "colorScheme": "Tango Light" + } + ], + "schemes": [ + { + "name": "Campbell", + "foreground": "#444444", + "background": "#444444", + "cursorColor": "#999999", + "black": "#444444", + "red": "#994444", + "green": "#494944", + "yellow": "#949444", + "blue": "#444494", + "purple": "#444449", + "cyan": "#444449", + "white": "#949499", + "brightBlack": "#444444", + "brightRed": "#994444", + "brightGreen": "#499444", + "brightYellow": "#999449", + "brightBlue": "#444999", + "brightPurple": "#994994", + "brightCyan": "#449494", + "brightWhite": "#999999" + }, + { + "name": "Tango Dark", + "foreground": "#D3D7CF", + "background": "#000000", + "cursorColor": "#FFFFFF", + "black": "#000000", + "red": "#CC0000", + "green": "#4E9A06", + "yellow": "#C4A000", + "blue": "#3465A4", + "purple": "#75507B", + "cyan": "#06989A", + "white": "#D3D7CF", + "brightBlack": "#555753", + "brightRed": "#EF2929", + "brightGreen": "#8AE234", + "brightYellow": "#FCE94F", + "brightBlue": "#729FCF", + "brightPurple": "#AD7FA8", + "brightCyan": "#34E2E2", + "brightWhite": "#EEEEEC" + }, + { + "name": "Tango Light", + "foreground": "#555753", + "background": "#FFFFFF", + "cursorColor": "#000000", + "black": "#000000", + "red": "#CC0000", + "green": "#4E9A06", + "yellow": "#C4A000", + "blue": "#3465A4", + "purple": "#75507B", + "cyan": "#06989A", + "white": "#D3D7CF", + "brightBlack": "#555753", + "brightRed": "#EF2929", + "brightGreen": "#8AE234", + "brightYellow": "#FCE94F", + "brightBlue": "#729FCF", + "brightPurple": "#AD7FA8", + "brightCyan": "#34E2E2", + "brightWhite": "#EEEEEC" + } + ] + })" }; + + static constexpr std::string_view userSettings{ R"({ + "profiles": { + "defaults": { }, + "list": [ + { + "name" : "profile0" + }, + { + "name" : "profile1", + "colorScheme": "Vintage" + }, + { + "name" : "profile2", + "colorScheme": "Tango Light" + } + ], + }, + "schemes": [ + { + "background": "#121314", + "black": "#121314", + "blue": "#121314", + "brightBlack": "#121314", + "brightBlue": "#121314", + "brightCyan": "#121314", + "brightGreen": "#121314", + "brightPurple": "#121314", + "brightRed": "#121314", + "brightWhite": "#121314", + "brightYellow": "#121314", + "cursorColor": "#121314", + "cyan": "#121314", + "foreground": "#121314", + "green": "#121314", + "name": "Tango Light", + "purple": "#121314", + "red": "#121314", + "selectionBackground": "#121314", + "white": "#121314", + "yellow": "#121314" + } + ] + })" }; + + // In this case, we have a fragment that overrides Campbell and adds Tango Light and Dark. + // The user is overriding Tango Light. + // We'll want to make sure that: + // 1. Campbell has the final modified settings, but does not have a user-owned modified fork. + // 2. Vintage is unmodified. + // 3. Tango Light needs a modified fork, which contains the user's modified copy + // 4. Tango Dark does not need a modified fork. + // The fragment also comes with a profile that uses Tango Light; it should be redirected to Tango Light (modified) + + SettingsLoader loader{ userSettings, inboxSettings }; + loader.MergeInboxIntoUserSettings(); + loader.MergeFragmentIntoUserSettings(L"TestFragment", fragment); + loader.FinalizeLayering(); + loader.FixupUserSettings(); + const auto settings = winrt::make_self(std::move(loader)); + + // VERIFY SCHEMES + const auto colorSchemes = settings->GlobalSettings().ColorSchemes(); + const auto scheme0 = winrt::get_self(colorSchemes.Lookup(L"Campbell")); + VERIFY_ARE_EQUAL(rgb(0x44, 0x44, 0x44), scheme0->Foreground()); + VERIFY_ARE_EQUAL(rgb(0x44, 0x44, 0x44), scheme0->Background()); + VERIFY_ARE_EQUAL(Model::OriginTag::Fragment, scheme0->Origin()); + + // Stock Vintage is untouched + const auto scheme1 = winrt::get_self(colorSchemes.Lookup(L"Vintage")); + VERIFY_ARE_EQUAL(rgb(0xc0, 0xc0, 0xc0), scheme1->Foreground()); + VERIFY_ARE_EQUAL(rgb(0x00, 0x00, 0x00), scheme1->Background()); + VERIFY_ARE_EQUAL(Model::OriginTag::InBox, scheme1->Origin()); + + // Stock Tango Light is untouched as well + const auto scheme2 = winrt::get_self(colorSchemes.Lookup(L"Tango Light")); + VERIFY_ARE_EQUAL(rgb(0x55, 0x57, 0x53), scheme2->Foreground()); + VERIFY_ARE_EQUAL(rgb(0xff, 0xff, 0xff), scheme2->Background()); + VERIFY_ARE_EQUAL(Model::OriginTag::Fragment, scheme2->Origin()); + + const auto scheme3 = winrt::get_self(colorSchemes.Lookup(L"Tango Light (Modified)")); + VERIFY_ARE_EQUAL(rgb(0x12, 0x13, 0x14), scheme3->Foreground()); + VERIFY_ARE_EQUAL(rgb(0x12, 0x13, 0x14), scheme3->Background()); + VERIFY_ARE_EQUAL(Model::OriginTag::User, scheme3->Origin()); + + // VERIFY PROFILES + const auto defaults{ settings->ProfileDefaults() }; + VERIFY_IS_FALSE(defaults.DefaultAppearance().HasColorSchemeName()); // User did not specify Campbell, Fragment edited it + VERIFY_ARE_EQUAL(L"Campbell", defaults.DefaultAppearance().ColorSchemeName()); + + const auto& profiles{ settings->AllProfiles() }; + { + const auto& prof0{ profiles.GetAt(0) }; + VERIFY_ARE_EQUAL(L"Campbell", prof0.DefaultAppearance().ColorSchemeName()); + } + { + const auto& prof1{ profiles.GetAt(1) }; + VERIFY_IS_TRUE(prof1.DefaultAppearance().HasColorSchemeName()); + VERIFY_ARE_EQUAL(L"Vintage", prof1.DefaultAppearance().ColorSchemeName()); + } + { + const auto& prof2{ profiles.GetAt(2) }; + VERIFY_IS_TRUE(prof2.DefaultAppearance().HasColorSchemeName()); + VERIFY_ARE_EQUAL(L"Tango Light (Modified)", prof2.DefaultAppearance().ColorSchemeName()); + } + { + const auto& prof3{ profiles.GetAt(3) }; + VERIFY_IS_TRUE(prof3.DefaultAppearance().HasColorSchemeName()); + VERIFY_ARE_EQUAL(L"Tango Light (Modified)", prof3.DefaultAppearance().ColorSchemeName()); + } + } } diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettings.h b/src/cascadia/TerminalSettingsModel/CascadiaSettings.h index 0eb2cf0964f..dd55f1a6b9e 100644 --- a/src/cascadia/TerminalSettingsModel/CascadiaSettings.h +++ b/src/cascadia/TerminalSettingsModel/CascadiaSettings.h @@ -62,6 +62,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation void MergeFragmentIntoUserSettings(const winrt::hstring& source, const std::string_view& content); void FinalizeLayering(); bool DisableDeletedProfiles(); + bool RemapColorSchemeForProfile(const winrt::com_ptr& profile); bool FixupUserSettings(); ParsedSettings inboxSettings; diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp index d055a50b621..3ae62ed55ee 100644 --- a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp +++ b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp @@ -98,6 +98,7 @@ SettingsLoader SettingsLoader::Default(const std::string_view& userJSON, const s SettingsLoader loader{ userJSON, inboxJSON }; loader.MergeInboxIntoUserSettings(); loader.FinalizeLayering(); + loader.FixupUserSettings(); return loader; } @@ -371,6 +372,33 @@ bool SettingsLoader::DisableDeletedProfiles() return newGeneratedProfiles; } +bool winrt::Microsoft::Terminal::Settings::Model::implementation::SettingsLoader::RemapColorSchemeForProfile(const winrt::com_ptr& profile) +{ + bool modified{ false }; + if (auto schemeName{ profile->DefaultAppearance().ColorSchemeName() }; !schemeName.empty()) + { + if (auto found{ userSettings.colorSchemeRemappings.find(schemeName) }; found != userSettings.colorSchemeRemappings.end()) + { + profile->DefaultAppearance().ColorSchemeName(found->second); + modified = true; + } + } + + if (auto unfocusedAppearance{ profile->UnfocusedAppearance() }) + { + if (auto schemeName{ unfocusedAppearance.ColorSchemeName() }; !schemeName.empty()) + { + if (auto found{ userSettings.colorSchemeRemappings.find(schemeName) }; found != userSettings.colorSchemeRemappings.end()) + { + unfocusedAppearance.ColorSchemeName(found->second); + modified = true; + } + } + } + + return modified; +} + // Runs migrations and fixups on user settings. // Returns true if something got changed and // the settings need to be saved to disk. @@ -390,8 +418,11 @@ bool SettingsLoader::FixupUserSettings() bool fixedUp = false; + RemapColorSchemeForProfile(userSettings.baseLayerProfile); for (const auto& profile : userSettings.profiles) { + fixedUp = RemapColorSchemeForProfile(profile) || fixedUp; + if (!profile->HasCommandline()) { continue; @@ -919,27 +950,6 @@ CascadiaSettings::CascadiaSettings(SettingsLoader&& loader) : allProfiles.reserve(loader.userSettings.profiles.size()); activeProfiles.reserve(loader.userSettings.profiles.size()); - auto remapColorSchemesForProfile{ [&](const winrt::com_ptr& profile) { - if (auto schemeName{ profile->DefaultAppearance().ColorSchemeName() }; !schemeName.empty()) - { - if (auto found{ loader.userSettings.colorSchemeRemappings.find(schemeName) }; found != loader.userSettings.colorSchemeRemappings.end()) - { - profile->DefaultAppearance().ColorSchemeName(found->second); - } - } - - if (auto unfocusedAppearance{ profile->UnfocusedAppearance() }) - { - if (auto schemeName{ unfocusedAppearance.ColorSchemeName() }; !schemeName.empty()) - { - if (auto found{ loader.userSettings.colorSchemeRemappings.find(schemeName) }; found != loader.userSettings.colorSchemeRemappings.end()) - { - unfocusedAppearance.ColorSchemeName(found->second); - } - } - } - } }; - for (const auto& colorScheme : loader.userSettings.colorSchemes) { loader.userSettings.globals->AddColorScheme(*colorScheme.second); @@ -950,8 +960,6 @@ CascadiaSettings::CascadiaSettings(SettingsLoader&& loader) : assert(loader.userSettings.globals != nullptr); assert(loader.userSettings.baseLayerProfile != nullptr); - remapColorSchemesForProfile(loader.userSettings.baseLayerProfile); - for (const auto& profile : loader.userSettings.profiles) { // If a generator stops producing a certain profile (e.g. WSL or PowerShell were removed) or @@ -968,8 +976,6 @@ CascadiaSettings::CascadiaSettings(SettingsLoader&& loader) : } } - remapColorSchemesForProfile(profile); - allProfiles.emplace_back(*profile); if (!profile->Hidden()) { From 56fad52bb81ef884004f26f116e0e31822891443 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Sun, 24 Apr 2022 17:04:09 -0500 Subject: [PATCH 03/30] Migrate spelling-0.0.21 changes from main --- .github/actions/spelling/README.md | 15 + .github/actions/spelling/advice.md | 34 +- .github/actions/spelling/allow/allow.txt | 24 +- .github/actions/spelling/allow/apis.txt | 23 +- .github/actions/spelling/allow/names.txt | 2 + .github/actions/spelling/candidate.patterns | 523 +++++++++++ .github/actions/spelling/excludes.txt | 45 +- .github/actions/spelling/expect/alphabet.txt | 8 - .github/actions/spelling/expect/expect.txt | 886 +++--------------- .github/actions/spelling/expect/web.txt | 23 - .../actions/spelling/line_forbidden.patterns | 62 ++ .../actions/spelling/patterns/patterns.txt | 82 +- .github/actions/spelling/reject.txt | 28 +- .github/workflows/spelling2.yml | 132 ++- 14 files changed, 1044 insertions(+), 843 deletions(-) create mode 100644 .github/actions/spelling/README.md create mode 100644 .github/actions/spelling/candidate.patterns create mode 100644 .github/actions/spelling/line_forbidden.patterns diff --git a/.github/actions/spelling/README.md b/.github/actions/spelling/README.md new file mode 100644 index 00000000000..4c40f7f02ac --- /dev/null +++ b/.github/actions/spelling/README.md @@ -0,0 +1,15 @@ +# check-spelling/check-spelling configuration + +File | Purpose | Format | Info +-|-|-|- +[allow/*.txt](allow/) | 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) +[patterns/*.txt](patterns/) | 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) +[candidate.patterns](candidate.patterns) | Patterns that might be worth adding to [patterns.txt](patterns.txt) | perl regular expression with optional comment block introductions (all matches will be suggested) | [candidates](https://github.com/check-spelling/check-spelling/wiki/Feature:-Suggest-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/spelling/advice.md b/.github/actions/spelling/advice.md index 885b1a6978d..d82df49ee22 100644 --- a/.github/actions/spelling/advice.md +++ b/.github/actions/spelling/advice.md @@ -1,4 +1,4 @@ - +
:pencil2: Contributor please read this @@ -6,7 +6,7 @@ By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later. -:warning: The command is written for posix shells. You can copy the contents of each `perl` command excluding the outer `'` marks and dropping any `'"`/`"'` quotation mark pairs into a file and then run `perl file.pl` from the root of the repository to run the code. Alternatively, you can manually insert the items... +:warning: The command is written for posix shells. If it doesn't work for you, you can manually _add_ (one word per line) / _remove_ items to `expect.txt` and the `excludes.txt` files. If the listed items are: @@ -20,31 +20,29 @@ See the `README.md` in each directory for more information. :microscope: You can test your commits **without** *appending* to a PR by creating a new branch with that extra change and pushing it to your fork. The [check-spelling](https://github.com/marketplace/actions/check-spelling) action will run in response to your **push** -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. :wink: -
:clamp: If you see a bunch of garbage -If it relates to a ... -
well-formed pattern +
If the flagged items are :exploding_head: false positives -See if there's a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it. +If items relate to a ... +* binary file (or some other file you wouldn't want to check at all). -If not, try writing one and adding it to a `patterns/{file}.txt`. + Please add a file path to the `excludes.txt` file matching the containing file. -Patterns are Perl 5 Regular Expressions - you can [test]( -https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines. + File paths are Perl 5 Regular Expressions - you can [test]( +https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files. -Note that patterns can't match multiline strings. -
-
binary-ish string + `^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md]( +../tree/HEAD/README.md) (on whichever branch you're using). -Please add a file path to the `excludes.txt` file instead of just accepting the garbage. +* well-formed pattern. -File paths are Perl 5 Regular Expressions - you can [test]( -https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files. + 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. -`^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md]( -../tree/HEAD/README.md) (on whichever branch you're using). -
+ Patterns are Perl 5 Regular Expressions - you can [test]( +https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines. + Note that patterns can't match multiline strings.
diff --git a/.github/actions/spelling/allow/allow.txt b/.github/actions/spelling/allow/allow.txt index 37a5b7d0f28..eaa0a471190 100644 --- a/.github/actions/spelling/allow/allow.txt +++ b/.github/actions/spelling/allow/allow.txt @@ -1,20 +1,21 @@ admins -apc +allcolors Apc -bsd +apc breadcrumb breadcrumbs +bsd calt -CMMI ccmp changelog clickable clig +CMMI copyable cybersecurity dalet -dcs Dcs +dcs dialytika dje downside @@ -26,36 +27,43 @@ EDDC Enum'd Fitt formattings +FTCS ftp fvar +gantt gcc geeksforgeeks ghe +github gje godbolt hostname hostnames +https hyperlink hyperlinking hyperlinks +iconify img inlined It'd kje libfuzzer +libuv liga lje Llast llvm Lmid locl +lol lorem Lorigin maxed +minimalistic mkmk mnt mru -noreply nje noreply ogonek @@ -76,13 +84,16 @@ runtimes shcha slnt Sos +ssh timeline timelines timestamped TLDR tokenizes tonos +toolset tshe +ubuntu uiatextrange UIs und @@ -91,6 +102,7 @@ versioned vsdevcmd We'd wildcards +XBox +YBox yeru zhe -allcolors diff --git a/.github/actions/spelling/allow/apis.txt b/.github/actions/spelling/allow/apis.txt index ad2ce887717..e0cc7550095 100644 --- a/.github/actions/spelling/allow/apis.txt +++ b/.github/actions/spelling/allow/apis.txt @@ -5,6 +5,7 @@ aclapi alignas alignof APPLYTOSUBMENUS +appxrecipe bitfield bitfields BUILDBRANCH @@ -14,6 +15,7 @@ BYCOMMAND BYPOSITION charconv CLASSNOTAVAILABLE +CLOSEAPP cmdletbinding COLORPROPERTY colspan @@ -28,9 +30,14 @@ dataobject dcomp DERR dlldata +DNE DONTADDTORECENT +DWMSBT +DWMWA +DWMWA DWORDLONG endfor +ENDSESSION enumset environstrings EXPCMDFLAGS @@ -70,6 +77,7 @@ IDirect IExplorer IFACEMETHOD IFile +IGraphics IInheritable IMap IMonarch @@ -84,6 +92,7 @@ istream IStringable ITab ITaskbar +itow IUri IVirtual KEYSELECT @@ -95,12 +104,15 @@ lround Lsa lsass LSHIFT +LTGRAY +MAINWINDOW memchr memicmp MENUCOMMAND MENUDATA -MENUITEMINFOW MENUINFO +MENUITEMINFOW +mmeapi MOUSELEAVE mov mptt @@ -136,16 +148,18 @@ OUTLINETEXTMETRICW overridable PACL PAGESCROLL +PATINVERT PEXPLICIT PICKFOLDERS pmr ptstr +QUERYENDSESSION rcx REGCLS RETURNCMD rfind -roundf ROOTOWNER +roundf RSHIFT SACL schandle @@ -154,6 +168,7 @@ serializer SETVERSION SHELLEXECUTEINFOW shobjidl +SHOWHIDE SHOWMINIMIZED SHOWTIP SINGLEUSE @@ -174,6 +189,8 @@ Stubless Subheader Subpage syscall +SYSTEMBACKDROP +TABROW TASKBARCREATED TBPF THEMECHANGED @@ -193,6 +210,8 @@ UOI UPDATEINIFILE userenv USEROBJECTFLAGS +Viewbox +virtualalloc wcsstr wcstoui winmain diff --git a/.github/actions/spelling/allow/names.txt b/.github/actions/spelling/allow/names.txt index 58b24116e63..1c6ef9a373c 100644 --- a/.github/actions/spelling/allow/names.txt +++ b/.github/actions/spelling/allow/names.txt @@ -69,6 +69,8 @@ Rincewind rprichard Schoonover shadertoy +Shomnipotence +simioni Somuah sonph sonpham diff --git a/.github/actions/spelling/candidate.patterns b/.github/actions/spelling/candidate.patterns new file mode 100644 index 00000000000..4b40e728ee3 --- /dev/null +++ b/.github/actions/spelling/candidate.patterns @@ -0,0 +1,523 @@ +# 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.*$ + +# patch hunk comments +^\@\@ -\d+(?:,\d+|) \+\d+(?:,\d+|) \@\@ .* +# git index header +index [0-9a-z]{7,40}\.\.[0-9a-z]{7,40} + +# cid urls +(['"])cid:.*?\g{-1} + +# data url in parens +\(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 url +data:[-a-zA-Z=;:/0-9+]*,\S* + +# mailto urls +mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,} + +# magnet urls +magnet:[?=:\w]+ + +# magnet urls +"magnet:[^"]+" + +# obs: +"obs:[^"]*" + +# The `\b` here means a break, it's the fancy way to handle urls, but it makes things harder to read +# In this examples content, I'm using a number of different ways to match things to show various approaches +# asciinema +\basciinema\.org/a/[0-9a-zA-Z]+ + +# apple +\bdeveloper\.apple\.com/[-\w?=/]+ +# Apple music +\bembed\.music\.apple\.com/fr/playlist/usr-share/[-\w.]+ + +# appveyor api +\bci\.appveyor\.com/api/projects/status/[0-9a-z]+ +# appveyor project +\bci\.appveyor\.com/project/(?:[^/\s"]*/){2}builds?/\d+/job/[0-9a-z]+ + +# Amazon + +# Amazon +\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|) +# AWS S3 +\b\w*\.s3[^.]*\.amazonaws\.com/[-\w/&#%_?:=]* +# AWS execute-api +\b[0-9a-z]{10}\.execute-api\.[-0-9a-z]+\.amazonaws\.com\b +# AWS ELB +\b\w+\.[-0-9a-z]+\.elb\.amazonaws\.com\b +# AWS SNS +\bsns\.[-0-9a-z]+.amazonaws\.com/[-\w/&#%_?:=]* +# AWS VPC +vpc-\w+ + +# While you could try to match `http://` and `https://` by using `s?` in `https?://`, sometimes there +# YouTube url +\b(?:(?:www\.|)youtube\.com|youtu.be)/(?:channel/|embed/|user/|playlist\?list=|watch\?v=|v/|)[-a-zA-Z0-9?&=_%]* +# YouTube music +\bmusic\.youtube\.com/youtubei/v1/browse(?:[?&]\w+=[-a-zA-Z0-9?&=_]*) +# YouTube tag +<\s*youtube\s+id=['"][-a-zA-Z0-9?_]*['"] +# YouTube image +\bimg\.youtube\.com/vi/[-a-zA-Z0-9?&=_]* +# Google Accounts +\baccounts.google.com/[-_/?=.:;+%&0-9a-zA-Z]* +# Google Analytics +\bgoogle-analytics\.com/collect.[-0-9a-zA-Z?%=&_.~]* +# Google APIs +\bgoogleapis\.(?:com|dev)/[a-z]+/(?:v\d+/|)[a-z]+/[-@:./?=\w+|&]+ +# Google Storage +\b[-a-zA-Z0-9.]*\bstorage\d*\.googleapis\.com(?:/\S*|) +# Google Calendar +\bcalendar\.google\.com/calendar(?:/u/\d+|)/embed\?src=[@./?=\w&%]+ +\w+\@group\.calendar\.google\.com\b +# Google DataStudio +\bdatastudio\.google\.com/(?:(?:c/|)u/\d+/|)(?:embed/|)(?:open|reporting|datasources|s)/[-0-9a-zA-Z]+(?:/page/[-0-9a-zA-Z]+|) +# The leading `/` here is as opposed to the `\b` above +# ... a short way to match `https://` or `http://` since most urls have one of those prefixes +# Google Docs +/docs\.google\.com/[a-z]+/(?:ccc\?key=\w+|(?:u/\d+|d/(?:e/|)[0-9a-zA-Z_-]+/)?(?:edit\?[-\w=#.]*|/\?[\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]+)* +# Google Maps +\bmaps\.google\.com/maps\?[\w&;=]* +# Google themes +themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+. +# Google CDN +\bclients2\.google(?:usercontent|)\.com[-0-9a-zA-Z/.]* +# Goo.gl +/goo\.gl/[a-zA-Z0-9]+ +# Google Chrome Store +\bchrome\.google\.com/webstore/detail/[-\w]*(?:/\w*|) +# Google Books +\bgoogle\.(?:\w{2,4})/books(?:/\w+)*\?[-\w\d=&#.]* +# Google Fonts +\bfonts\.(?:googleapis|gstatic)\.com/[-/?=:;+&0-9a-zA-Z]* +# Google Forms +\bforms\.gle/\w+ +# Google Scholar +\bscholar\.google\.com/citations\?user=[A-Za-z0-9_]+ +# Google Colab Research Drive +\bcolab\.research\.google\.com/drive/[-0-9a-zA-Z_?=]* + +# GitHub SHAs (api) +\bapi.github\.com/repos(?:/[^/\s"]+){3}/[0-9a-f]+\b +# GitHub SHAs (markdown) +(?:\[`?[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 wiki +\bgithub\.com/(?:[^/]+/){2}wiki/(?:(?:[^/]+/|)_history|[^/]+(?:/_compare|)/[0-9a-f.]{40,})\b +# githubusercontent +/[-a-z0-9]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]* +# githubassets +\bgithubassets.com/[0-9a-f]+(?:[-/\w.]+) +# gist github +\bgist\.github\.com/[^/\s"]+/[0-9a-f]+ +# git.io +\bgit\.io/[0-9a-zA-Z]+ +# GitHub JSON +"node_id": "[-a-zA-Z=;:/0-9+]*" +# Contributor +\[[^\]]+\]\(https://github\.com/[^/\s"]+\) +# GHSA +GHSA(?:-[0-9a-z]{4}){3} + +# GitLab commit +\bgitlab\.[^/\s"]*/\S+/\S+/commit/[0-9a-f]{7,16}#[0-9a-f]{40}\b +# GitLab merge requests +\bgitlab\.[^/\s"]*/\S+/\S+/-/merge_requests/\d+/diffs#[0-9a-f]{40}\b +# GitLab uploads +\bgitlab\.[^/\s"]*/uploads/[-a-zA-Z=;:/0-9+]* +# GitLab commits +\bgitlab\.[^/\s"]*/(?:[^/\s"]+/){2}commits?/[0-9a-f]+\b + +# binanace +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]+ +# bitbucket repositories commits +\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}commits?/[0-9a-f]+ +# bitbucket commits +\bbitbucket\.org/(?:[^/\s"]+/){2}commits?/[0-9a-f]+ + +# bit.ly +\bbit\.ly/\w+ + +# bitrise +\bapp\.bitrise\.io/app/[0-9a-f]*/[\w.?=&]* + +# bootstrapcdn.com +\bbootstrapcdn\.com/[-./\w]+ + +# cdn.cloudflare.com +\bcdnjs\.cloudflare\.com/[./\w]+ + +# circleci +\bcircleci\.com/gh(?:/[^/\s"]+){1,5}.[a-z]+\?[-0-9a-zA-Z=&]+ + +# gitter +\bgitter\.im(?:/[^/\s"]+){2}\?at=[0-9a-f]+ + +# gravatar +\bgravatar\.com/avatar/[0-9a-f]+ + +# ibm +[a-z.]*ibm\.com/[-_#=:%!?~.\\/\d\w]* + +# imgur +\bimgur\.com/[^.]+ + +# Internet Archive +\barchive\.org/web/\d+/(?:[-\w.?,'/\\+&%$#_:]*) + +# discord +/discord(?:app\.com|\.gg)/(?:invite/)?[a-zA-Z0-9]{7,} + +# Disqus +\bdisqus\.com/[-\w/%.()!?&=_]* + +# medium link +\blink\.medium\.com/[a-zA-Z0-9]+ +# medium +\bmedium\.com/\@?[^/\s"]+/[-\w]+ + +# microsoft +\b(?:https?://|)(?:(?:download\.visualstudio|docs|msdn2?|research)\.microsoft|blogs\.msdn)\.com/[-_a-zA-Z0-9()=./%]* +# powerbi +\bapp\.powerbi\.com/reportEmbed/[^"' ]* +# vs devops +\bvisualstudio.com(?::443|)/[-\w/?=%&.]* +# microsoft store +\bmicrosoft\.com/store/apps/\w+ + +# mvnrepository.com +\bmvnrepository\.com/[-0-9a-z./]+ + +# now.sh +/[0-9a-z-.]+\.now\.sh\b + +# oracle +\bdocs\.oracle\.com/[-0-9a-zA-Z./_?#&=]* + +# chromatic.com +/\S+.chromatic.com\S*[")] + +# codacy +\bapi\.codacy\.com/project/badge/Grade/[0-9a-f]+ + +# compai +\bcompai\.pub/v1/png/[0-9a-f]+ + +# mailgun api +\.api\.mailgun\.net/v3/domains/[0-9a-z]+\.mailgun.org/messages/[0-9a-zA-Z=@]* +# mailgun +\b[0-9a-z]+.mailgun.org + +# /message-id/ +/message-id/[-\w@./%]+ + +# Reddit +\breddit\.com/r/[/\w_]* + +# requestb.in +\brequestb\.in/[0-9a-z]+ + +# sched +\b[a-z0-9]+\.sched\.com\b + +# Slack url +slack://[a-zA-Z0-9?&=]+ +# Slack +\bslack\.com/[-0-9a-zA-Z/_~?&=.]* +# Slack edge +\bslack-edge\.com/[-a-zA-Z0-9?&=%./]+ +# Slack images +\bslack-imgs\.com/[-a-zA-Z0-9?&=%.]+ + +# shields.io +\bshields\.io/[-\w/%?=&.:+;,]* + +# stackexchange -- https://stackexchange.com/feeds/sites +\b(?:askubuntu|serverfault|stack(?:exchange|overflow)|superuser).com/(?:questions/\w+/[-\w]+|a/) + +# Sentry +[0-9a-f]{32}\@o\d+\.ingest\.sentry\.io\b + +# Twitter markdown +\[\@[^[/\]:]*?\]\(https://twitter.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)\) +# Twitter hashtag +\btwitter\.com/hashtag/[\w?_=&]* +# Twitter status +\btwitter\.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|) +# Twitter profile images +\btwimg\.com/profile_images/[_\w./]* +# Twitter media +\btwimg\.com/media/[-_\w./?=]* +# Twitter link shortened +\bt\.co/\w+ + +# facebook +\bfburl\.com/[0-9a-z_]+ +# facebook CDN +\bfbcdn\.net/[\w/.,]* +# facebook watch +\bfb\.watch/[0-9A-Za-z]+ + +# dropbox +\bdropbox\.com/sh?/[^/\s"]+/[-0-9A-Za-z_.%?=&;]+ + +# ipfs protocol +ipfs://[0-9a-z]* +# ipfs url +/ipfs/[0-9a-z]* + +# w3 +\bw3\.org/[-0-9a-zA-Z/#.]+ + +# loom +\bloom\.com/embed/[0-9a-f]+ + +# regex101 +\bregex101\.com/r/[^/\s"]+/\d+ + +# figma +\bfigma\.com/file(?:/[0-9a-zA-Z]+/)+ + +# freecodecamp.org +\bfreecodecamp\.org/[-\w/.]+ + +# image.tmdb.org +\bimage\.tmdb\.org/[/\w.]+ + +# mermaid +\bmermaid\.ink/img/[-\w]+|\bmermaid-js\.github\.io/mermaid-live-editor/#/edit/[-\w]+ + +# Wikipedia +\ben\.wikipedia\.org/wiki/[-\w%.#]+ + +# gitweb +[^"\s]+/gitweb/\S+;h=[0-9a-f]+ + +# HyperKitty lists +/archives/list/[^@/]+\@[^/\s"]*/message/[^/\s"]*/ + +# lists +/thread\.html/[^"\s]+ + +# list-management +\blist-manage\.com/subscribe(?:[?&](?:u|id)=[0-9a-f]+)+ + +# kubectl.kubernetes.io/last-applied-configuration +"kubectl.kubernetes.io/last-applied-configuration": ".*" + +# pgp +\bgnupg\.net/pks/lookup[?&=0-9a-zA-Z]* + +# Spotify +\bopen\.spotify\.com/embed/playlist/\w+ + +# Mastodon +\bmastodon\.[-a-z.]*/(?:media/|\@)[?&=0-9a-zA-Z_]* + +# scastie +\bscastie\.scala-lang\.org/[^/]+/\w+ + +# images.unsplash.com +\bimages\.unsplash\.com/(?:(?:flagged|reserve)/|)[-\w./%?=%&.;]+ + +# pastebin +\bpastebin\.com/[\w/]+ + +# heroku +\b\w+\.heroku\.com/source/archive/\w+ + +# quip +\b\w+\.quip\.com/\w+(?:(?:#|/issues/)\w+)? + +# badgen.net +\bbadgen\.net/badge/[^")\]'\s]+ + +# statuspage.io +\w+\.statuspage\.io\b + +# media.giphy.com +\bmedia\.giphy\.com/media/[^/]+/[\w.?&=]+ + +# tinyurl +\btinyurl\.com/\w+ + +# getopts +\bgetopts\s+(?:"[^"]+"|'[^']+') + +# ANSI color codes +(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m + +# URL escaped characters +\%[0-9A-F][A-F] +# 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) +0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP] +# Punycode +\bxn--[-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} +# hex runs +\b[0-9a-fA-F]{16,}\b +# hex in url queries +=[0-9a-fA-F]*?(?:[A-F]{3,}|[a-f]{3,})[0-9a-fA-F]*?& +# ssh +(?:ssh-\S+|-nistp256) [-a-zA-Z=;:/0-9+]{12,} + +# PGP +\b(?:[0-9A-F]{4} ){9}[0-9A-F]{4}\b +# GPG keys +\b(?:[0-9A-F]{4} ){5}(?: [0-9A-F]{4}){5}\b +# Well known gpg keys +.well-known/openpgpkey/[\w./]+ + +# 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 +# integrity +integrity="sha\d+-[-a-zA-Z=;:/0-9+]{40,}" + +# https://www.gnu.org/software/groff/manual/groff.html +# man troff content +\\f[BCIPR] +# ' +\\\(aq + +# .desktop mime types +^MimeTypes?=.*$ +# .desktop localized entries +^[A-Z][a-z]+\[[a-z]+\]=.*$ +# Localized .desktop content +Name\[[^\]]+\]=.* + +# IServiceProvider +\bI(?=(?:[A-Z][a-z]{2,})+\b) + +# crypt +"\$2[ayb]\$.{56}" + +# scrypt / argon +\$(?:scrypt|argon\d+[di]*)\$\S+ + +# Input to GitHub JSON +content: "[-a-zA-Z=;:/0-9+]*=" + +# Python stringprefix / binaryprefix +# 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 +(?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 (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 +\bset(?:\s+-[abefimouxE]{1,2})*\s+-[abefimouxE]{3,}(?:\s+-[abefimouxE]+)* +# tar arguments +\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+ +# tput arguments -- https://man7.org/linux/man-pages/man5/terminfo.5.html -- technically they can be more than 5 chars long... +\btput\s+(?:(?:-[SV]|-T\s*\w+)\s+)*\w{3,5}\b +# macOS temp folders +/var/folders/\w\w/[+\w]+/(?:T|-Caches-)/ diff --git a/.github/actions/spelling/excludes.txt b/.github/actions/spelling/excludes.txt index ec940e1dbfc..bc509a5669e 100644 --- a/.github/actions/spelling/excludes.txt +++ b/.github/actions/spelling/excludes.txt @@ -1,28 +1,39 @@ +# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes (?:(?i)\.png$) +(?:^|/)(?i)COPYRIGHT +(?:^|/)(?i)LICEN[CS]E +(?:^|/)3rdparty/ (?:^|/)dirs$ (?:^|/)go\.mod$ (?:^|/)go\.sum$ -(?:^|/)package-lock\.json$ +(?:^|/)package(?:-lock|)\.json$ (?:^|/)sources(?:|\.dep)$ -SUMS$ +(?:^|/)vendor/ +\.a$ \.ai$ +\.avi$ \.bmp$ +\.bz2$ \.cer$ \.class$ \.crl$ \.crt$ \.csr$ \.dll$ +\.docx?$ +\.drawio$ \.DS_Store$ \.eot$ \.eps$ \.exe$ \.gif$ +\.gitattributes$ \.graffle$ \.gz$ \.icns$ \.ico$ \.jar$ +\.jks$ \.jpeg$ \.jpg$ \.key$ @@ -30,28 +41,53 @@ SUMS$ \.lock$ \.map$ \.min\.. +\.mod$ \.mp3$ \.mp4$ +\.o$ +\.ocf$ \.otf$ \.pbxproj$ \.pdf$ \.pem$ +\.png$ \.psd$ +\.pyc$ \.runsettings$ +\.s$ \.sig$ \.so$ \.svg$ \.svgz$ +\.svgz?$ \.tar$ \.tgz$ +\.tiff?$ \.ttf$ \.vsdx$ +\.wav$ +\.webm$ +\.webp$ \.woff +\.woff2?$ \.xcf$ \.xls +\.xlsx?$ \.xpm$ \.yml$ \.zip$ +^\.github/actions/spelling/ +^\.github/fabricbot.json$ +^\.gitignore$ +^\Q.git-blame-ignore-revs\E$ +^\Q.github/workflows/spelling.yml\E$ +^\Qdoc/reference/windows-terminal-logo.ans\E$ +^\Qsamples/ConPTY/EchoCon/EchoCon/EchoCon.vcxproj.filters\E$ +^\Qsrc/host/exe/Host.EXE.vcxproj.filters\E$ +^\Qsrc/host/ft_host/chafa.txt\E$ +^\Qsrc/tools/closetest/CloseTest.vcxproj.filters\E$ +^\XamlStyler.json$ +^build/config/ ^consolegit2gitfilters\.json$ ^dep/ ^doc/reference/master-sequence-list.csv$ @@ -77,6 +113,5 @@ SUMS$ ^src/tools/U8U16Test/(?:fr|ru|zh)\.txt$ ^src/types/ut_types/UtilsTests.cpp$ ^tools/ReleaseEngineering/ServicingPipeline.ps1$ -^\.github/actions/spelling/ -^\.gitignore$ -^\XamlStyler.json$ +ignore$ +SUMS$ diff --git a/.github/actions/spelling/expect/alphabet.txt b/.github/actions/spelling/expect/alphabet.txt index 47663b0d075..23933713a40 100644 --- a/.github/actions/spelling/expect/alphabet.txt +++ b/.github/actions/spelling/expect/alphabet.txt @@ -5,26 +5,19 @@ AAAAAABBBBBBCCC AAAAABBBBBBCCC abcd abcd -abcde -abcdef -ABCDEFG -ABCDEFGH ABCDEFGHIJ abcdefghijk ABCDEFGHIJKLMNO abcdefghijklmnop ABCDEFGHIJKLMNOPQRST -abcdefghijklmnopqrstuvwxyz ABCG ABE abf BBBBB BBBBBBBB -BBBBBBBBBBBBBBDDDD BBBBBCCC BBBBCCCCC BBGGRR -CCE EFG EFGh QQQQQQQQQQABCDEFGHIJ @@ -33,7 +26,6 @@ QQQQQQQQQQABCDEFGHIJKLMNOPQRSTQQQQQQQQQQ QQQQQQQQQQABCDEFGHIJPQRSTQQQQQQQQQQ qrstuvwxyz qwerty -QWERTYUIOP qwertyuiopasdfg YYYYYYYDDDDDDDDDDD ZAAZZ diff --git a/.github/actions/spelling/expect/expect.txt b/.github/actions/spelling/expect/expect.txt index a68bc4a326c..8f8f4828d0a 100644 --- a/.github/actions/spelling/expect/expect.txt +++ b/.github/actions/spelling/expect/expect.txt @@ -1,20 +1,19 @@ +aabbcc ABANDONFONT +abbcc +ABCDEFGHIJKLMNOPQRSTUVWXY abgr abi +ABORTIFHUNG ACCESSTOKEN -acec -acf acidev ACIOSS ACover actctx ACTCTXW activatable -ACTIVEBORDER -ACTIVECAPTION ADDALIAS ADDREF -addressof ADDSTRING ADDTOOL AEnd @@ -26,51 +25,39 @@ ahz AImpl AInplace ALIGNRIGHT -alloc allocing +allocs alpc ALTERNATENAME ALTF ALTNUMPAD ALWAYSTIP amd -ansicode ansicpg ANSISYS ANSISYSRC ANSISYSSC -antialias antialiasing ANull anycpu -AOn APARTMENTTHREADED APCs -api APIENTRY -apimswincoresynchl apiset APPBARDATA -appconsult appcontainer -APPICON appium -applet appletname +applets applicationmodel APPLMODAL appmodel -apps APPWINDOW APrep apsect APSTUDIO archeologists -architected argb -argc -args -argv ARRAYSIZE ARROWKEYS asan @@ -80,22 +67,15 @@ ASDF asdfghjkl ASetting ASingle -asm -asmv asmx -aspx -astextplain -AStomps ASYNCWINDOWPOS atch ATest -attr ATTRCOLOR aumid Authenticode AUTOBUDDY AUTOCHECKBOX -autogenerated autohide AUTOHSCROLL automagically @@ -104,37 +84,30 @@ AUTORADIOBUTTON autoscrolling Autowrap AVerify -AVI AVX awch -azuredevopspodcast azzle -backend backgrounded Backgrounder backgrounding -backport +backported backstory barbaz Batang -baz Bazz BBDM bbwe bcount -bcrypt bcx bcz BEFOREPARENT beginthread -bgcolor bgfx bgidx Bgk BGR -BGRA +bgra BHID -biblioscape bigobj binplace binplaced @@ -143,15 +116,12 @@ bitcrazed bitflag bitmask BITOPERATION -bitsavers -bitset +bitsets BKCOLOR BKGND Bksp -blog Blt BLUESCROLL -bmp BODGY BOLDFONT BOOLIFY @@ -167,44 +137,34 @@ bpp BPPF branchconfig brandings -BRK Browsable -bsearch Bspace bstr BTNFACE -buf bufferout buffersize buflen -bugfix buildtransitive BUILDURI burriter BValue -byref -bytearray bytebuffer cac cacafire -callee capslock CARETBLINKINGENABLED CARRIAGERETURN cascadia -cassert castsi catid cazamor CBash -cbegin cbiex CBN CBoolean cbt cbuffer CCCBB -ccf cch CCHAR cci @@ -215,17 +175,11 @@ CComp CConsole CConversion CCRT -cctype -CDATA cdd -cdecl CDeclaration CEdit CELLSIZE -cend -cerr cfae -Cfg cfie cfiex cfte @@ -233,49 +187,33 @@ CFuzz cgscrn chafa changelist +chaof charinfo -charlespetzold -charset CHARSETINFO -chcp -checkbox -checkboxes -Checkin chh -Childitem chk -chrono CHT Cic -cjk -ckuehl -cla +CLA Clcompile CLE cleartype CLICKACTIVE clickdown -climits clipbrd CLIPCHILDREN CLIPSIBLINGS -cliutils -clocale closetest cloudconsole cls CLSCTX -clsid +clsids CLUSTERMAP -cmath cmatrix cmder CMDEXT -Cmdlet -cmdline cmh CMOUSEBUTTONS -cmp cmpeq cmt cmw @@ -283,18 +221,16 @@ cmyk CNL cnt CNTRL -codebase Codeflow codepage codepath -codepoint -codeproject +codepoints coinit COLLECTIONURI colorizing -colororacle -colorref -colorscheme +COLORMATRIX +COLORREFs +colorschemes colorspaces colorspec colortable @@ -303,34 +239,27 @@ colortest colortool COLR combaseapi -combobox comctl COMDAT commandline commctrl commdlg COMMITID -compat componentization conapi conareainfo conattrs conbufferout -concat concfg conclnt conddkrefs -condev condrv conechokey conemu -config configurability conhost -conhostv conime conimeinfo -conint conintegrity conintegrityuwp coninteractivitybase @@ -356,108 +285,76 @@ consolehost CONSOLEIME consoleinternal Consoleroot -Consolescreen CONSOLESETFOREGROUND consoletaeftemplates -CONSOLEV +consoleuwp Consolewait CONSOLEWINDOWOWNER consrv -constexpr constexprable constness contentfiles conterm -CONTEXTMENU contsf contypes convarea conwinuserrefs -coord coordnew COPYCOLOR CORESYSTEM cotaskmem countof -cout CPG cpinfo CPINFOEX CPLINFO cplusplus -cpp -CPPARM CPPCORECHECK cppcorecheckrules -cppm cpprest cpprestsdk cppwinrt -CPPx CProc cpx -crbegin CREATESCREENBUFFER CREATESTRUCT CREATESTRUCTW -creativecommons cred -cref -crend -Crisman +crisman CRLFs crloew Crt CRTLIBS csbi csbiex -csharp CSHORT -CSIDL Cspace -csproj -Csr csrmsg CSRSS csrutil -css -cstdarg -cstddef -cstdio -cstdlib -cstr -cstring cstyle -csv CSwitch CTerminal CText -ctime ctl ctlseqs -Ctlv -ctor CTRLEVENT +CTRLFREQUENCY CTRLKEYSHORTCUTS -Ctx +CTRLVOLUME Ctxt -ctype CUF cupxy -curated CURRENTFONT currentmode CURRENTPAGE CURSORCOLOR CURSORSIZE CURSORTYPE +CUsers CUU Cwa cwch -cwchar -cwctype -cwd -cxcy CXFRAME CXFULLSCREEN CXHSCROLL @@ -467,14 +364,11 @@ CXSIZE CXSMICON CXVIRTUALSCREEN CXVSCROLL -cxx CYFRAME CYFULLSCREEN -cygwin CYHSCROLL CYMIN CYPADDEDBORDER -CYRL CYSIZE CYSIZEFRAME CYSMICON @@ -482,8 +376,6 @@ CYVIRTUALSCREEN CYVSCROLL dai DATABLOCK -DATAVIEW -DATAW DBatch dbcs DBCSCHAR @@ -496,12 +388,10 @@ DBGOUTPUT dbh dblclk DBlob -dbproj -DBUILD DColor DCOLORVALUE dcommon -DCompile +dcompile dcompiler DComposition dde @@ -510,41 +400,44 @@ DDevice DEADCHAR dealloc Debian -debolden debugtype DECAC DECALN DECANM +DECARM DECAUPSS DECAWM +DECBKM +DECCARA DECCKM DECCOLM DECCRA +DECCTR DECDHL decdld -DECDLD DECDWL DECEKBD +DECERA +DECFRA DECID DECKPAM DECKPM DECKPNM DECLRMM -decls -declspec -decltype -declval DECNKM DECNRCM DECOM -deconstructed DECPCTERM +DECPS +DECRARA DECRC DECREQTPARM DECRLM DECRQM DECRQSS -DECRST +DECRQTSR +decrst +DECSACE DECSASD DECSC DECSCA @@ -553,19 +446,17 @@ DECSCPP DECSCUSR DECSED DECSEL +DECSERA DECSET DECSLPP DECSLRM DECSMKR DECSR -decstandar DECSTBM DECSTR DECSWL DECTCEM -Dedupe -deduplicate -deduplicated +DECXCPR DEFAPP DEFAULTBACKGROUND DEFAULTFOREGROUND @@ -581,39 +472,22 @@ defing DEFPUSHBUTTON defterm DELAYLOAD -deletable DELETEONRELEASE -delims Delt demoable depersist deprioritized -deps -deque -deref -deserialization -deserialize -deserialized -deserializer -deserializing +deserializers desktopwindowxamlsource -dest DESTINATIONNAME -devblogs devicecode -devicefamily -devops Dext DFactory DFF -DFMT dhandler dialogbox -diffing -DINLINE directio DIRECTX -Dirs DISABLEDELAYEDEXPANSION DISABLENOSCROLL DISPLAYATTRIBUTE @@ -622,28 +496,21 @@ DISPLAYCHANGE distro dlg DLGC -dll -dllexport DLLGETVERSIONPROC -dllimport dllinit dllmain DLLVERSIONINFO DLOAD DLOOK dmp -DOCTYPE -docx DONTCARE doskey dotnet -doubleclick -downlevel DPG -dpi DPIAPI DPICHANGE DPICHANGED +DPIs dpix dpiy dpnx @@ -651,149 +518,114 @@ DRAWFRAME DRAWITEM DRAWITEMSTRUCT drcs -dropdown -DROPDOWNLIST DROPFILES drv +DSBCAPS +DSBLOCK +DSBPLAY +DSBUFFERDESC +DSBVOLUME dsm -dst +dsound +DSSCL DSwap DTest -dtor DTTERM DUMMYUNIONNAME -DUNICODE -DUNIT dup'ed dvi dwl DWLP dwm dwmapi -dword +DWORDs dwrite -dwriteglyphrundescriptionclustermap dxgi dxgidwm +dxguid dxinterop -dxp dxsm dxttbmp Dyreen -eaf EASTEUROPE ECH echokey ecount ECpp +ect Edgium EDITKEYS EDITTEXT EDITUPDATE edputil -edu Efast EHsc EINS EJO ELEMENTNOTAVAILABLE elems -elif -elseif emacs EMPTYBOX enabledelayedexpansion -endian -endif -endl -endlocal endptr endregion -ENQ -enqueuing -entrypoint +ENTIREBUFFER +entrypoints ENU -enum ENUMLOGFONT ENUMLOGFONTEX enumranges -envvar -eol +eplace EPres EQU ERASEBKGND -errno -errorlevel -ETB etcoreapp ETW -ETX EUDC EVENTID eventing everytime evflags evt -ewdelete -exe execd -executables executionengine exemain EXETYPE +exeuwp exewin exitwin expectedinput -expr EXPUNGECOMMANDHISTORY EXSTYLE EXTENDEDEDITKEY EXTKEY EXTTEXTOUT -fabricbot facename FACENODE FACESIZE -failfast FAILIFTHERE -fallthrough -FARPROC fastlink -fcb fcharset -fclose -fcntl -fdc -FDD -fdopen fdw fesb FFDE FFrom fgbg FGCOLOR -fgetc -fgetwc FGHIJ fgidx FGs FILEDESCRIPTION -fileno -filepath FILESUBTYPE FILESYSPATH -filesystem -FILETYPE fileurl FILEW FILLATTR FILLCONSOLEOUTPUT FILTERONPASTE -finalizer FINDCASE FINDDLG FINDDOWN -FINDSTR FINDSTRINGEXACT FINDUP FIter @@ -801,11 +633,9 @@ FIXEDCONVERTED FIXEDFILEINFO Flg flyout -fmix fmodern fmtarg fmtid -FNV FOLDERID FONTCHANGE fontdlg @@ -814,8 +644,7 @@ FONTENUMPROC FONTFACE FONTFAMILY FONTHEIGHT -FONTINFO -fontlist +fontinfo FONTOK FONTSIZE FONTSTRING @@ -825,28 +654,20 @@ FONTWEIGHT FONTWIDTH FONTWINDOW fooo -forceinline FORCEOFFFEEDBACK FORCEONFEEDBACK -FORCEV -foreach -fprintf framebuffer FRAMECHANGED fre -freopen -frontend +frontends fsanitize Fscreen FSCTL FSINFOCLASS -fsproj -fstream fte Ftm -fullscreen +Fullscreens fullwidth -func FUNCTIONCALL fuzzer fuzzmain @@ -858,10 +679,10 @@ fwlink GAUSSIAN gci gcx -gcy gdi gdip gdirenderer +Geddy geopol GETALIAS GETALIASES @@ -871,7 +692,6 @@ GETALIASEXESLENGTH GETAUTOHIDEBAREX GETCARETWIDTH getch -getchar GETCLIENTAREAANIMATION GETCOMMANDHISTORY GETCOMMANDHISTORYLENGTH @@ -896,7 +716,6 @@ GETKEYBOARDLAYOUTNAME GETKEYSTATE GETLARGESTWINDOWSIZE GETLBTEXT -getline GETMINMAXINFO GETMOUSEINFO GETMOUSEVANISH @@ -906,8 +725,6 @@ GETOBJECT GETPOS GETSELECTIONINFO getset -GETSTATE -GETTEXT GETTEXTLEN GETTITLE GETWAITTOKILLSERVICETIMEOUT @@ -915,7 +732,6 @@ GETWAITTOKILLTIMEOUT GETWHEELSCROLLCHARACTERS GETWHEELSCROLLCHARS GETWHEELSCROLLLINES -getwriter GFEh Gfun gfx @@ -924,23 +740,17 @@ GHIJK GHIJKL GHIJKLM gitfilters -github -gitlab +gitmodules gle -globals +GLOBALFOCUS GLYPHENTRY -gmail GMEM GNUC Goldmine gonce -Google goutput -GPUs -grayscale GREENSCROLL Grehan -grep Greyscale gridline groupbox @@ -948,22 +758,16 @@ gset gsl GTP GTR -guardxfg guc -gui guidatom -guiddef GValue GWL GWLP gwsz HABCDEF Hackathon -halfwidth HALTCOND HANGEUL -hardcoded -hardcodes hashalg HASSTRINGS hbitmap @@ -978,7 +782,6 @@ hdr HDROP hdrstop HEIGHTSCROLL -hfile hfont hfontresource hglobal @@ -986,11 +789,9 @@ hhh hhook hhx HIBYTE -HICON +hicon HIDEWINDOW -HIGHLIGHTTEXT hinst -HINSTANCE Hirots HISTORYBUFS HISTORYNODUP @@ -1003,40 +804,31 @@ hkl HKLM hlocal hlsl -HMENU hmod hmodule hmon -HMONITOR -horiz HORZ hostable hostlib HPA -HPAINTBUFFER HPCON hpj -hpp HPR -HPROPSHEETPAGE HProvider HREDRAW hresult -HRSRC +hrottled hscroll hsl hstr hstring -hsv HTBOTTOMLEFT HTBOTTOMRIGHT HTCAPTION HTCLIENT HTLEFT -htm HTMAXBUTTON HTMINBUTTON -html HTMLTo HTRIGHT HTTOP @@ -1047,36 +839,17 @@ HVP hwheel hwnd HWNDPARENT -hxx -IAccessibility -IAction -IApi -IApplication -IBase -ICache -icacls iccex -icch -IChar -ico -IComponent +icket ICONERROR Iconified ICONINFORMATION IConsole ICONSTOP -IControl ICONWARNING -ICore -IData IDCANCEL IDD -IDesktop -IDevice -IDictionary IDISHWND -IDispatch -IDisposable idl idllib IDOK @@ -1084,36 +857,18 @@ IDR idth idx IDXGI -IDynamic IEnd IEnum -IEnumerable -ies -ietf IFACEMETHODIMP -ifdef ification -ifndef -IFont -ifstream IGNOREEND IGNORELANGUAGE -IHigh IHosted iid -IInitialize -IInput -IInspectable -IInteract -IInteractivity IIo -IList -imagemagick -Imatch ime Imm -IMouse -impl +IMPEXP inbox inclusivity INCONTEXT @@ -1121,104 +876,59 @@ INFOEX inheritcursor inheritdoc inheritfrom -ini INITCOMMONCONTROLSEX INITDIALOG initguid INITMENU inkscape -inl INLINEPREFIX inlines -INotify -inout -inplace inproc Inputkeyinfo INPUTPROCESSORPROFILE inputrc Inputreadhandledata INSERTMODE -intellisense INTERACTIVITYBASE INTERCEPTCOPYPASTE INTERNALNAME -interop -interoperability inthread -intptr -intrin intsafe INVALIDARG INVALIDATERECT -inwap -IObservable ioctl -iomanip -iostream -iot -ipa ipch -ipconfig -IPersist ipp IProperty IPSINK ipsp -IRaw -IRead -IReference -IRender -IScheme -ISelection IShell -issuecomment -IState -IStoryboard -isupper ISwap -iswdigit -iswspace -ISystem iterm itermcolors ITerminal -IText itf Ith itoa IUI -IUia IUnknown ivalid -IValue -IVector -IWait -iwch -IWeb -IWin -IWindow -IXaml +IWIC IXMP -ixx +IXP jconcpp JOBOBJECT JOBOBJECTINFOCLASS jpe -jpeg -jpg JPN -json -jsonc jsoncpp +Jsons jsprovider jumplist KAttrs kawa -kayla Kazu kazum -kbd kcub kcud kcuf @@ -1226,13 +936,11 @@ kcuu kernelbase kernelbasestaging KEYBDINPUT -keybinding keychord keydown keyevent KEYFIRST KEYLAST -keymap Keymapping keyscan keystate @@ -1252,22 +960,19 @@ langid LANGUAGELIST lasterror lastexitcode -LATN LAYOUTRTL +lbl LBN -LBound LBUTTON LBUTTONDBLCLK LBUTTONDOWN LBUTTONUP lcb +lci LCONTROL LCTRL lcx LEFTALIGN -LEFTSHIFT -len -lhs libpopcnt libsancov libtickit @@ -1277,17 +982,11 @@ LINESELECTION LINEWRAP LINKERRCAP LINKERROR -linkid -linkpath linputfile -Linq -linux -listbox listproperties listptr listptrsize lld -LLVM llx LMENU LMNOP @@ -1299,39 +998,28 @@ LOADONCALL loadu LOBYTE localappdata -localhost locsrc -locstudio Loewen LOGFONT LOGFONTA LOGFONTW logissue -lowercased loword lparam -lparen -LPBYTE LPCCH lpch -LPCHARSETINFO -LPCOLORREF LPCPLINFO LPCREATESTRUCT lpcs -LPCSTR LPCTSTR -LPCWSTR lpdata LPDBLIST lpdis LPDRAWITEMSTRUCT lpdw -LPDWORD lpelfe lpfn LPFNADDPROPSHEETPAGE -LPINT lpl LPMEASUREITEMSTRUCT LPMINMAXINFO @@ -1341,44 +1029,38 @@ LPNEWCPLINFOA LPNEWCPLINFOW LPNMHDR lpntme -LPPOINT LPPROC LPPROPSHEETPAGE LPPSHNOTIFY lprc -LPRECT lpstr lpsz LPTSTR LPTTFONTLIST lpv -LPVOID LPW LPWCH +lpwfx LPWINDOWPOS lpwpos lpwstr LRESULT -lru lsb lsconfig -lsproj lss lstatus lstrcmp lstrcmpi LTEXT LTLTLTLTL -ltrim -ltype LUID +luma lval LVB LVERTICAL LWA LWIN lwkmvj -mailto majorly makeappx MAKEINTRESOURCE @@ -1387,14 +1069,11 @@ MAKELANGID MAKELONG MAKELPARAM MAKELRESULT -malloc -manpage MAPBITMAP MAPVIRTUALKEY MAPVK MAXDIMENSTRING maxing -MAXLENGTH MAXSHORT maxval maxversiontested @@ -1410,35 +1089,25 @@ MDs MEASUREITEM megamix memallocator -memcmp -memcpy -memmove -memset MENUCHAR MENUCONTROL MENUDROPALIGNMENT -MENUITEM MENUITEMINFO MENUSELECT -Mersenne messageext -metadata metaproj midl mii MIIM milli -mimetype mincore mindbogglingly -mingw minimizeall minkernel MINMAXINFO minwin minwindef Mip -mkdir MMBB mmcc MMCPL @@ -1447,70 +1116,48 @@ MNC MNOPQ MNOPQR MODALFRAME -modelproj MODERNCORE MONITORINFO MONITORINFOEXW MONITORINFOF -monospaced -monostate MOUSEACTIVATE MOUSEFIRST MOUSEHWHEEL MOUSEMOVE -mousewheel movemask MOVESTART msb -msbuild -mscorlib msctf msctls msdata -MSDL -msdn msft MSGCMDLINEF MSGF MSGFILTER MSGFLG MSGMARKMODE -MSGS MSGSCROLLMODE MSGSELECTMODE msiexec MSIL msix -mspartners msrc -msvcrt MSVCRTD msys -msysgit MTSM -mui -Mul -multiline munged munges murmurhash -mutex -mutexes muxes myapplet mydir -myignite MYMAX Mypair Myval NAMELENGTH nameof -namespace -namespaced namestream -nano natvis -nbsp NCCALCSIZE NCCREATE NCLBUTTONDOWN @@ -1522,16 +1169,12 @@ NCRBUTTONDOWN NCRBUTTONUP NCXBUTTONDOWN NCXBUTTONUP -NDEBUG -ned NEL -NEQ netcoreapp netstandard NEWCPLINFO NEWCPLINFOA NEWCPLINFOW -newcursor Newdelete NEWINQUIRE NEWINQURE @@ -1541,23 +1184,16 @@ NEWTEXTMETRICEX Newtonsoft NEXTLINE nfe -nlength -Nls NLSMODE nnn NOACTIVATE NOAPPLYNOW NOCLIP -NOCOLOR NOCOMM NOCONTEXTHELP NOCOPYBITS -nodefaultlib -nodiscard NODUP -noexcept -NOHELP -noinline +noexcepts NOINTEGRALHEIGHT NOINTERFACE NOLINKINFO @@ -1573,13 +1209,13 @@ NONINFRINGEMENT NONPREROTATED nonspace NOOWNERZORDER +Nop NOPAINT NOPQRST noprofile NOREDRAW NOREMOVE NOREPOSITION -noreturn NORMALDISPLAY NOSCRATCH NOSEARCH @@ -1588,24 +1224,17 @@ NOSENDCHANGING NOSIZE NOSNAPSHOT NOTHOUSANDS -nothrow NOTICKS +NOTIMEOUTIFNOTHUNG NOTIMPL -notin -notmatch -NOTNULL NOTOPMOST NOTRACK NOTSUPPORTED nouicompat nounihan NOUPDATE -novtable -NOWAIT NOYIELD NOZORDER -NPM -npos nrcs NSTATUS ntapi @@ -1617,6 +1246,7 @@ ntdll ntifs ntlpcapi ntm +nto ntrtl ntstatus ntsubauth @@ -1627,31 +1257,25 @@ ntuser NTVDM ntverp NTWIN -nuget nugetversions nullability nullness nullonfailure -nullopt -nullptr +nullopts NULs numlock numpad NUMSCROLL nupkg -nuspec NVIDIA -NVR OACR -oauth objbase -ocf ocolor odl -oem oemcp OEMFONT OEMFORMAT +OEMs offboarded OLEAUT OLECHAR @@ -1674,9 +1298,7 @@ openconsoleproxy OPENIF OPENLINK openps -opensource openvt -openxmlformats ORIGINALFILENAME osc OSCBG @@ -1687,20 +1309,15 @@ OSCSCB OSCSCC OSCWT OSDEPENDSROOT -osfhandle OSG OSGENG osign oss -ostream -ostringstream +otepad ouicompat OUnter outdir -outfile -Outof OUTOFCONTEXT -OUTOFMEMORY Outptr outstr OVERLAPPEDWINDOW @@ -1716,15 +1333,12 @@ PAINTPARAMS PAINTSTRUCT PALPC pankaj -params parentable parms passthrough PATCOPY pathcch PATTERNID -PBOOL -PBYTE pcat pcb pcch @@ -1733,7 +1347,6 @@ PCCONSOLE PCD pcg pch -PCHAR PCIDLIST PCIS PCLIENT @@ -1755,18 +1368,13 @@ PCWCH PCWCHAR PCWSTR pda -pdb -pdbonly +Pdbs pdbstr -pdf -pdp pdtobj pdw -PDWORD pdx peb PEMAGIC -PENDTASKMSG pfa PFACENODE pfed @@ -1780,17 +1388,13 @@ PFS pgd pgdn PGONu -pgorepro -pgort -PGU pguid pgup -PHANDLE phhook phwnd -pid pidl PIDLIST +pids pii pinvoke pipename @@ -1799,17 +1403,12 @@ pixelheight PIXELSLIST PJOBOBJECT pkey -placeholders platforming playsound -plist -PLOC -PLOCA -PLOCM +ploc +ploca +plocm PLOGICAL -plugin -PMv -png pnm PNMLINK pntm @@ -1817,27 +1416,21 @@ PNTSTATUS POBJECT Podcast POINTSLIST -Poli POLYTEXTW -popd -POPF poppack -popup POPUPATTR +popups PORFLG positionals -posix POSTCHARBREAKS POSX POSXSCROLL POSYSCROLL -ppci PPEB ppf ppguid ppidl pplx -PPORT PPROC PPROCESS ppropvar @@ -1848,18 +1441,12 @@ ppsz ppv ppwch PQRST -pragma prc prealigned -prebuilt -precomp prect prefast -prefilled prefs preinstalled -PRELOAD -PREMULTIPLIED prepopulated presorted PREVENTPINNING @@ -1868,14 +1455,11 @@ PREVIEWWINDOW PREVLINE prg pri -printf prioritization processenv processhost PROCESSINFOCLASS procs -Progman -proj PROPERTYID PROPERTYKEY PROPERTYVAL @@ -1889,7 +1473,6 @@ propvar propvariant propvarutil psa -psd PSECURITY pseudocode pseudoconsole @@ -1897,13 +1480,10 @@ pseudoterminal psh pshn PSHNOTIFY -PSHORT pshpack PSINGLE psl psldl -psm -PSMALL PSNRET PSobject psp @@ -1912,46 +1492,36 @@ psr PSTR psz ptch -ptr -ptrdiff +ptrs ptsz PTYIn PUCHAR -PULONG PUNICODE -pushd -putchar -putwchar -PVOID pwch -PWCHAR PWDDMCONSOLECONTEXT -PWORD pws -pwsh pwstr pwsz pythonw +Qaabbcc qos QRSTU -qsort -queryable +QUERYOPEN QUESTIONMARK quickedit QUZ QWER +Qxxxxxxxxxxxxxxx qzmp RAII RALT rasterbar rasterfont rasterization -rawinput RAWPATH raytracers razzlerc rbar -rbegin RBUTTON RBUTTONDBLCLK RBUTTONDOWN @@ -1967,37 +1537,23 @@ RCOCW RCONTROL RCOW rcv -rdbuf -RDONLY -rdpartysource readback READCONSOLE READCONSOLEOUTPUT READCONSOLEOUTPUTSTRING -Readline -readme READMODE -readonly -READWRITE -realloc +reallocs reamapping rects redef redefinable Redir -redirector redist -redistributable REDSCROLL -refactor -refactoring REFCLSID -refcount -referencesource REFGUID REFIID REFPROPERTYKEY -regex REGISTEROS REGISTERVDM regkey @@ -2013,24 +1569,20 @@ reparenting replatformed Replymessage repositorypath +Requiresx rescap Resequence RESETCONTENT resheader -resizable resmimetype -restrictedcapabilities resw resx -retval rfa -rfc rfid rftp -rgb -rgba RGBCOLOR rgbi +rgbs rgci rgfae rgfte @@ -2043,51 +1595,43 @@ rgs rgui rgw rgwch -rhs RIGHTALIGN RIGHTBUTTON riid Rike RIPMSG RIS -RMENU -rng roadmap robomac -roundtrip -rparen +rosetta +roundtrips RRF RRRGGGBB rsas rtcore RTEXT -rtf RTFTo -Rtl RTLREADING Rtn -rtrim RTTI ruleset runas -runasradio RUNDLL runformat runft RUNFULLSCREEN +runfuzz runsettings -runtests +runtest runtimeclass runuia runut runxamlformat -rvalue RVERTICAL rvpa RWIN rxvt safearray -SAFECAST safemath sapi sba @@ -2100,18 +1644,15 @@ scancode scanline schemename SCL -scm SCRBUF SCRBUFSIZE screenbuffer SCREENBUFFERINFO screeninfo -screenshot +screenshots scriptload -Scrollable scrollback -scrollbar -Scroller +scrollbars SCROLLFORWARD SCROLLINFO scrolllock @@ -2121,18 +1662,14 @@ SCROLLSCREENBUFFER scursor sddl sdeleted -sdk SDKDDK -searchbox securityappcontainer segfault SELCHANGE SELECTALL -selectany SELECTEDFONT SELECTSTRING Selfhosters -SERIALIZERS SERVERDLL SETACTIVE SETBUDDYINT @@ -2143,7 +1680,6 @@ SETCURSOR SETCURSORINFO SETCURSORPOSITION SETDISPLAYMODE -setfill SETFOCUS SETFONT SETFOREGROUND @@ -2154,28 +1690,24 @@ setintegritylevel SETITEMDATA SETITEMHEIGHT SETKEYSHORTCUTS -setlocal -setlocale SETMENUCLOSE -setmode SETNUMBEROFCOMMANDS SETOS SETPALETTE -SETPOS SETRANGE SETSCREENBUFFERSIZE SETSEL SETTEXTATTRIBUTE SETTINGCHANGE -SETTITLE -setw Setwindow SETWINDOWINFO +SFGAO +SFGAOF sfi SFINAE +SFolder SFUI sgr -SHANDLE SHCo shcore shellapi @@ -2183,7 +1715,6 @@ shellex shellscalingapi SHFILEINFO SHGFI -SHGFP SHIFTJIS Shl shlguid @@ -2191,12 +1722,13 @@ shlobj shlwapi SHORTPATH SHOWCURSOR +SHOWDEFAULT SHOWMAXIMIZED SHOWMINNOACTIVE +SHOWNA SHOWNOACTIVATE SHOWNORMAL SHOWWINDOW -SHRT sidebyside SIF SIGDN @@ -2205,7 +1737,6 @@ SINGLETHREADED siup sixel SIZEBOX -sizeof SIZESCROLL SKIPFONT SKIPOWNPROCESS @@ -2226,29 +1757,19 @@ Solutiondir somefile SOURCEBRANCH sourced -SOURCESDIRECTORY spammy spand -sprintf -sqlproj -srand -src SRCCODEPAGE SRCCOPY SRCINVERT srcsrv SRCSRVTRG srctool -sre srect srv srvinit srvpipe ssa -ssh -sstream -stackoverflow -standalone STARTF STARTUPINFO STARTUPINFOEX @@ -2261,58 +1782,36 @@ Statusline stdafx STDAPI stdc -stdcall stdcpp -stderr -stdexcept -stdin -stdio STDMETHODCALLTYPE STDMETHODIMP -stdout -stgm +STGM stl -stoi -stol -stoul stoutapot Stri -strikethrough -stringstream +Stringable STRINGTABLE -strlen strrev strsafe -strtok -structs STUBHEAD STUVWX -STX stylecop SUA subcompartment -subfolder +subfolders subkey SUBLANG -sublicensable -submenu subresource -subspan -substr subsystemconsole subsystemwindows suiteless -svg swapchain swapchainpanel swappable SWMR SWP -swprintf SYMED -symlink SYNCPAINT -sys syscalls SYSCHAR SYSCOMMAND @@ -2332,8 +1831,6 @@ TARG targetentrypoint TARGETLIBS TARGETNAME -targetnametoken -targetsize targetver taskbar tbar @@ -2348,23 +1845,20 @@ TCI tcome tcommandline tcommands +Tdd TDelegated TDP TEAMPROJECT tearoff Teb -techcommunity -technet tellp -telnet -telnetd -templated teraflop terminalcore +terminalinput +terminalrenderdata TERMINALSCROLLING terminfo TEs -testapp testbuildplatform testcon testd @@ -2373,7 +1867,6 @@ testenv testlab testlist testmd -testmddefinition testmode testname testnameprefix @@ -2388,7 +1881,6 @@ texel TExpected textattribute TEXTATTRIBUTEID -textbox textboxes textbuffer TEXTINCLUDE @@ -2396,57 +1888,48 @@ textinfo TEXTMETRIC TEXTMETRICW textmode +texttests TFCAT tfoo TFunction tga -threadpool THUMBPOSITION THUMBTRACK TIcon -tif tilunittests -Timeline -timelines titlebar TITLEISLINKNAME TJson TLambda +TLDP TLEN Tlgdata TMAE TMPF TMult tmultiple -tmux -todo +TODOs tofrom tokenhelpers -tokenized -tokenizing toolbars TOOLINFO -Toolset -tooltip +TOOLWINDOW TOPDOWNDIB TOPLEFT -toplevel TOPRIGHT TOpt tosign touchpad -towlower -towupper Tpp Tpqrst tprivapi tracelog tracelogging traceloggingprovider +traceviewpp trackbar TRACKCOMPOSITION trackpad -transcoder transitioning Trd TREX @@ -2455,43 +1938,32 @@ triaging TRIANGLESTRIP Tribool TRIMZEROHEADINGS -truetype trx tsattrs tsf +tsgr TStr TSTRFORMAT TSub TTBITMAP -ttf TTFONT TTFONTLIST tthe tthis TTM TTo -TVPP +tvpp Txtev typechecked -typechecking -typedef -typeid -typeinfo typelib -typename -typeof typeparam TYUI UAC uap uapadmin UAX -ubuntu ucd -ucdxml uch -UCHAR -ucs udk UDM uer @@ -2500,42 +1972,30 @@ uia UIACCESS uiacore uiautomationcore -Uid uielem UIELEMENTENABLEDONLY -uint -uintptr +UINTs ulcch -ulong -umd +umul +umulh Unadvise unattend -uncomment UNCPRIORITY -undef -Unescape unexpand -Unfocus unhighlighting unhosted -unicode -UNICODESTRING UNICODETEXT UNICRT -uninit uninitialize -uninstall -unintense +Unintense Uniscribe -unittest unittesting -universaltest +unittests unk unknwn unmark UNORM unparseable -unpause unregistering untests untextured @@ -2544,11 +2004,6 @@ UPDATEDISPLAY UPDOWN UPKEY UPSS -upvote -uri -url -urlencoded -USASCII usebackq USECALLBACK USECOLOR @@ -2562,44 +2017,29 @@ USEPOSITION userbase USERDATA userdpiapi -username Userp userprivapi -userprofile USERSRV USESHOWWINDOW USESIZE USESTDHANDLES -ushort usp USRDLL -utf -utils utr -uuid -uuidof -uuidv UVWX UVWXY -UWA -UWAs +uwa uwp uxtheme -vals Vanara vararg -vbproj vclib -Vcount vcpkg vcprintf -vcproj vcxitems -vcxproj vec vectorized VERCTRL -versioning VERTBAR VFT vga @@ -2608,30 +2048,26 @@ viewkind viewports Virt VIRTTERM -Virtualizing vkey VKKEYSCAN VMs VPA -VPATH VPR VProc VRaw VREDRAW vsc +vsconfig vscprintf VSCROLL vsdevshell vsinfo -vsnprintf vso vspath -vsprintf VSTAMP vstest VSTS VSTT -vstudio vswhere vtapi vtapp @@ -2650,61 +2086,43 @@ vttest VWX waaay waitable -waivable WANSUNG WANTARROWS WANTTAB wapproj -wav +WAVEFORMATEX wbuilder wch -wchar +wchars WCIA WCIW -WClass -wcout -wcschr -wcscmp -wcscpy WCSHELPER wcsicmp -wcslen wcsnicmp -wcsrchr wcsrev -wcstod -wcstoul wddm wddmcon -wddmconrenderer WDDMCONSOLECONTEXT wdm -wdx -webclient webpage -website -websocket +websites +websockets wekyb -WEOF wex wextest wextestclass -wfdopen WFill wfopen -wfstream WHelper -whitelisting +wic WIDTHSCROLL Widthx -wiki -wikia -wikipedia wil WImpl WINAPI winbase winbasep +wincodec wincon winconp winconpty @@ -2714,15 +2132,12 @@ wincontypes WINCORE windbg WINDEF -windev -WINDIR windll WINDOWALPHA Windowbuffer windowdpiapi WINDOWEDGE windowext -WINDOWFRAME windowime WINDOWINFO windowio @@ -2734,15 +2149,14 @@ WINDOWPOSCHANGING windowproc windowrect windowsapp -windowsdeveloper windowsinternalstring WINDOWSIZE +windowsshell +windowsterminal windowsx -WINDOWTEXT windowtheme WINDOWTITLE winevent -winfx wingdi winget WINIDE @@ -2756,16 +2170,12 @@ Winperf WInplace winres winrt -winsdk wintelnet winternl winuser winuserp WINVER wistd -wixproj -wline -wlinestream wmain wmemory WMSZ @@ -2780,9 +2190,6 @@ WNull wnwb workarea workaround -workflow -workitem -wostream WOutside WOWARM WOWx @@ -2792,11 +2199,9 @@ wpf WPR WPrep WPresent -wprintf wprp wprpi wregex -WResult writeback writechar WRITECONSOLE @@ -2810,12 +2215,8 @@ WRunoff WScript wsl WSLENV -wsmatch -WSpace -wss wstr -wstring -wstringstream +wstrings wsz wtd WTest @@ -2830,13 +2231,14 @@ wtypes Wubi WUX WVerify -wwaproj WWith wxh +wyhash +wymix +wyr xact -xaml Xamlmeta -xargs +xamls xaz xbf xbutton @@ -2852,49 +2254,43 @@ xdy XEncoding xes xff -xfg XFile XFORM +xin +xinchaof +xinxinchaof XManifest XMath XMFLOAT -xml -xmlns -xor xorg -XPosition XResource -xsd xsi -xsize xstyler XSubstantial xtended -xterm XTest XTPOPSGR XTPUSHSGR xtr +XTWINOPS xunit xutr -xvalue XVIRTUALSCREEN XWalk -Xzn +xwwyzz +xxyyzz yact -YAML YCast YCENTER YCount YDPI -yml YOffset -YPosition -YSize YSubstantial YVIRTUALSCREEN YWalk +Zabcdefghijklmnopqrstuvwxyz ZCmd ZCtrl -zsh zxcvbnm +ZYXWVU +ZYXWVUTd diff --git a/.github/actions/spelling/expect/web.txt b/.github/actions/spelling/expect/web.txt index 60ae118cb48..52c1cfd1f0f 100644 --- a/.github/actions/spelling/expect/web.txt +++ b/.github/actions/spelling/expect/web.txt @@ -1,29 +1,6 @@ -http -www -easyrgb -php -ecma -rapidtables WCAG -freedesktop -ycombinator -robertelder -kovidgoyal -leonerd -fixterms winui appshellintegration mdtauk -cppreference gfycat Guake -azurewebsites -askubuntu -dostips -viewtopic -rosettacode -Rexx -tldp -HOWTO -uwspace -uwaterloo diff --git a/.github/actions/spelling/line_forbidden.patterns b/.github/actions/spelling/line_forbidden.patterns new file mode 100644 index 00000000000..31ad2ddcd26 --- /dev/null +++ b/.github/actions/spelling/line_forbidden.patterns @@ -0,0 +1,62 @@ +# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere +# \bm_data\b + +# If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test, +# you might not want to check in code where you were debugging w/ `fit()`, in which case, you might want +# to use this: +#\bfit\( + +# 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. greater than +\bgreater then\b + +# s.b. into +#\sin to\s + +# s.b. opt-in +\sopt in\s + +# s.b. less than +\bless then\b + +# s.b. otherwise +\bother[- ]wise\b + +# s.b. nonexistent +\bnon existing\b +\b[Nn]o[nt][- ]existent\b + +# s.b. preexisting +[Pp]re[- ]existing + +# s.b. preempt +[Pp]re[- ]empt\b + +# s.b. preemptively +[Pp]re[- ]emptively + +# s.b. reentrancy +[Rr]e[- ]entrancy + +# s.b. reentrant +[Rr]e[- ]entrant + +# s.b. workaround(s) +#\bwork[- ]arounds?\b + +# Reject duplicate words +\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s diff --git a/.github/actions/spelling/patterns/patterns.txt b/.github/actions/spelling/patterns/patterns.txt index 2fc6e0b708c..a0e1931f36f 100644 --- a/.github/actions/spelling/patterns/patterns.txt +++ b/.github/actions/spelling/patterns/patterns.txt @@ -1,11 +1,6 @@ -https://(?:(?:[-a-zA-Z0-9?&=]*\.|)microsoft\.com)/[-a-zA-Z0-9?&=_#\/.]* -https://aka\.ms/[-a-zA-Z0-9?&=\/_]* -https://www\.itscj\.ipsj\.or\.jp/iso-ir/[-0-9]+\.pdf -https://www\.vt100\.net/docs/[-a-zA-Z0-9#_\/.]* -https://www.w3.org/[-a-zA-Z0-9?&=\/_#]* -https://(?:(?:www\.|)youtube\.com|youtu.be)/[-a-zA-Z0-9?&=]* -https://(?:[a-z-]+\.|)github(?:usercontent|)\.com/[-a-zA-Z0-9?%&=_\/.+]* -https://www.xfree86.org/[-a-zA-Z0-9?&=\/_#]* +# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns + +https?://\S+ [Pp]ublicKeyToken="?[0-9a-fA-F]{16}"? (?:[{"]|UniqueIdentifier>)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:[}"]|v# +(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) + +# hit-count: 20 file-count: 9 +# hex runs +\b[0-9a-fA-F]{16,}\b + +# hit-count: 10 file-count: 7 +# uuid: +\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b + +# hit-count: 4 file-count: 4 +# mailto urls +mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,} + +# hit-count: 4 file-count: 1 +# ANSI color codes +(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m + +# hit-count: 2 file-count: 1 +# latex +\\(?:n(?:ew|ormal|osub)|r(?:enew)|t(?:able(?:of|)|he|itle))(?=[a-z]+) + +# hit-count: 1 file-count: 1 +# 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 + +# hit-count: 1 file-count: 1 +# Non-English +[a-zA-Z]*[ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]* + +# hit-count: 1 file-count: 1 +# French +# This corpus only had capital letters, but you probably want lowercase ones as well. +\b[LN]'+[a-z]{2,}\b + +# acceptable duplicates +# ls directory listings +[-bcdlpsw](?:[-r][-w][-sx]){3}\s+\d+\s+(\S+)\s+\g{-1}\s+\d+\s+ +# C/idl types + English ... +\s(Guid|long|LONG|that) \g{-1}\s + +# javadoc / .net +(?:[\\@](?:groupname|param)|(?:public|private)(?:\s+static|\s+readonly)*)\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*$ + +# Autogenerated revert commit message +^This reverts commit [0-9a-f]{40}\.$ + +# vtmode +--vtmode\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/spelling/reject.txt b/.github/actions/spelling/reject.txt index e2763f35a82..301719de47e 100644 --- a/.github/actions/spelling/reject.txt +++ b/.github/actions/spelling/reject.txt @@ -1,22 +1,12 @@ ^attache$ ^attacher$ ^attachers$ -^spae$ -^spaebook$ -^spaecraft$ -^spaed$ -^spaedom$ -^spaeing$ -^spaeings$ -^spae-man$ -^spaeman$ -^spaer$ -^Spaerobee$ -^spaes$ -^spaewife$ -^spaewoman$ -^spaework$ -^spaewright$ -^wether$ -^wethers$ -^wetherteg$ +benefitting +occurences? +^dependan.* +^oer$ +Sorce +^[Ss]pae.* +^untill$ +^untilling$ +^wether.* diff --git a/.github/workflows/spelling2.yml b/.github/workflows/spelling2.yml index a44931267ee..446b24343ed 100644 --- a/.github/workflows/spelling2.yml +++ b/.github/workflows/spelling2.yml @@ -1,20 +1,134 @@ # spelling.yml is blocked per https://github.com/check-spelling/check-spelling/security/advisories/GHSA-g86g-chm8-7r2p name: Spell checking + +# Comment management is handled through a secondary job, for details see: +# 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) +# 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 +# or collapse a comment (in the case where it had previously made a comment and now no longer needs to show a comment) +# it needs `pull-requests: write` in order to manipulate those comments. + +# Updating pull request branches is managed via comment handling. +# For details, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-expect-list +# +# These elements work together to make it happen: +# +# `on.issue_comment` +# This event listens to comments by users asking to update the metadata. +# +# `jobs.update` +# This job runs in response to an issue_comment and will push a new commit +# to update the spelling metadata. +# +# `with.experimental_apply_changes_via_bot` +# Tells the action to support and generate messages that enable it +# to make a commit to update the spelling metadata. +# +# `with.ssh_key` +# In order to trigger workflows when the commit is made, you can provide a +# secret (typically, a write-enabled github deploy key). +# +# For background, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-with-deploy-key + on: - pull_request_target: push: + branches: + - "**" + tags-ignore: + - "**" + pull_request_target: + branches: + - "**" + tags-ignore: + - "**" + types: + - 'opened' + - 'reopened' + - 'synchronize' + issue_comment: + types: + - 'created' jobs: spelling: name: Spell checking + permissions: + contents: read + pull-requests: read + actions: read + outputs: + followup: ${{ steps.spelling.outputs.followup }} + runs-on: ubuntu-latest + 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 + cancel-in-progress: true + steps: + - name: check-spelling + id: spelling + uses: check-spelling/check-spelling@v0.0.21 + with: + suppress_push_for_open_pull_request: 1 + checkout: true + check_file_names: 1 + spell_check_this: check-spelling/spell-check-this@prerelease + post_comment: 0 + use_magic_file: 1 + extra_dictionary_limit: 10 + extra_dictionaries: + cspell:software-terms/src/software-terms.txt + cspell:python/src/python/python-lib.txt + cspell:node/node.txt + cspell:cpp/src/stdlib-c.txt + cspell:cpp/src/stdlib-cpp.txt + cspell:fullstack/fullstack.txt + cspell:filetypes/filetypes.txt + cspell:html/html.txt + cspell:cpp/src/compiler-msvc.txt + cspell:python/src/common/extra.txt + cspell:powershell/powershell.txt + cspell:aws/aws.txt + cspell:cpp/src/lang-keywords.txt + cspell:npm/npm.txt + cspell:dotnet/dotnet.txt + cspell:python/src/python/python.txt + cspell:css/css.txt + cspell:cpp/src/stdlib-cmath.txt + check_extra_dictionaries: '' + + comment-push: + name: Report (Push) + # If your workflow isn't running on push, you can remove this job + runs-on: ubuntu-latest + needs: spelling + permissions: + contents: write + if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push' + steps: + - name: comment + uses: check-spelling/check-spelling@v0.0.21 + with: + checkout: true + spell_check_this: check-spelling/spell-check-this@prerelease + task: ${{ needs.spelling.outputs.followup }} + + comment-pr: + name: Report (PR) + # If you workflow isn't running on pull_request*, you can remove this job runs-on: ubuntu-latest + needs: spelling + permissions: + pull-requests: write + if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request') steps: - - name: checkout-merge - if: "contains(github.event_name, 'pull_request')" - uses: actions/checkout@v2 + - name: comment + uses: check-spelling/check-spelling@v0.0.21 with: - ref: refs/pull/${{github.event.pull_request.number}}/merge - - name: checkout - if: "!contains(github.event_name, 'pull_request')" - uses: actions/checkout@v2 - - uses: check-spelling/check-spelling@v0.0.19 + checkout: true + spell_check_this: check-spelling/spell-check-this@prerelease + task: ${{ needs.spelling.outputs.followup }} From 00a3f6e4d34758b6eaf801adbd27ed2cc31963d3 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Wed, 27 Sep 2023 18:09:07 -0500 Subject: [PATCH 04/30] Fix for main --- .../ColorSchemeViewModel.cpp | 5 ++++ .../ColorSchemeViewModel.h | 2 +- .../ColorSchemeViewModel.idl | 2 +- .../ColorSchemesPageViewModel.cpp | 1 - .../CascadiaSettingsSerialization.cpp | 26 ++++++++++++------- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.cpp b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.cpp index 4bd995b6c4a..81e2727c62a 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.cpp +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.cpp @@ -74,6 +74,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _NotifyChanges(L"IsDefaultScheme"); } + bool ColorSchemeViewModel::IsInBoxScheme() const + { + return _scheme.Origin() != Model::OriginTag::User; + } + bool ColorSchemeViewModel::RequestRename(winrt::hstring newName) { if (const auto parentPageVM{ _parentPageVM.get() }) diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h index 539b0636c3c..8a8bf0b23a5 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h @@ -32,6 +32,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation Editor::ColorTableEntry ColorEntryAt(uint32_t index); bool IsDefaultScheme(); void RefreshIsDefault(); + bool IsInBoxScheme() const; void DeleteConfirmation_Click(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::RoutedEventArgs& e); void SetAsDefault_Click(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::RoutedEventArgs& e); @@ -39,7 +40,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation // DON'T YOU DARE ADD A `WINRT_CALLBACK(PropertyChanged` TO A CLASS DERIVED FROM ViewModelHelper. Do this instead: using ViewModelHelper::PropertyChanged; - WINRT_PROPERTY(bool, IsInBoxScheme); WINRT_PROPERTY(Windows::Foundation::Collections::IVector, NonBrightColorTable, nullptr); WINRT_PROPERTY(Windows::Foundation::Collections::IVector, BrightColorTable, nullptr); diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl index 3247ef125e3..fe9caa2d9ed 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl @@ -8,7 +8,7 @@ namespace Microsoft.Terminal.Settings.Editor runtimeclass ColorSchemeViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged, Windows.Foundation.IStringable { String Name; - Boolean IsInBoxScheme; + Boolean IsInBoxScheme { get; }; Boolean IsDefaultScheme { get; }; Boolean RequestRename(String newName); diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp b/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp index 9fdb4c75766..18316cf4ee9 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp @@ -83,7 +83,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation { const auto scheme = pair.Value(); auto viewModel{ winrt::make(scheme, *this, _settings) }; - viewModel.IsInBoxScheme(scheme.Origin() != Model::OriginTag::User); allColorSchemes.emplace_back(viewModel); // We will need access to the settings model object later, but we don't diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp index 26239576f8e..3b49dfabbaf 100644 --- a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp +++ b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp @@ -414,25 +414,31 @@ bool SettingsLoader::DisableDeletedProfiles() bool winrt::Microsoft::Terminal::Settings::Model::implementation::SettingsLoader::RemapColorSchemeForProfile(const winrt::com_ptr& profile) { bool modified{ false }; - if (auto schemeName{ profile->DefaultAppearance().ColorSchemeName() }; !schemeName.empty()) - { - if (auto found{ userSettings.colorSchemeRemappings.find(schemeName) }; found != userSettings.colorSchemeRemappings.end()) + auto remapForAppearance = [&](const IAppearanceConfig& appearance) { + if (auto schemeName{ appearance.LightColorSchemeName() }; !schemeName.empty()) { - profile->DefaultAppearance().ColorSchemeName(found->second); - modified = true; + if (auto found{ userSettings.colorSchemeRemappings.find(schemeName) }; found != userSettings.colorSchemeRemappings.end()) + { + appearance.LightColorSchemeName(found->second); + modified = true; + } } - } - if (auto unfocusedAppearance{ profile->UnfocusedAppearance() }) - { - if (auto schemeName{ unfocusedAppearance.ColorSchemeName() }; !schemeName.empty()) + if (auto schemeName{ appearance.DarkColorSchemeName() }; !schemeName.empty()) { if (auto found{ userSettings.colorSchemeRemappings.find(schemeName) }; found != userSettings.colorSchemeRemappings.end()) { - unfocusedAppearance.ColorSchemeName(found->second); + appearance.DarkColorSchemeName(found->second); modified = true; } } + }; + + remapForAppearance(profile->DefaultAppearance()); + + if (auto unfocusedAppearance{ profile->UnfocusedAppearance() }) + { + remapForAppearance(unfocusedAppearance); } return modified; From 2ada4fc52e3b4b91cf0796b4a45390ea6b7c7d84 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Fri, 23 Feb 2024 13:07:32 -0600 Subject: [PATCH 05/30] Force users to duplicate inbox schemes; make duplicate work --- .../ColorSchemeViewModel.cpp | 8 +++++++ .../ColorSchemeViewModel.h | 1 + .../ColorSchemeViewModel.idl | 1 + .../ColorSchemesPageViewModel.cpp | 18 ++++++++++++++ .../ColorSchemesPageViewModel.h | 1 + .../ColorSchemesPageViewModel.idl | 1 + .../EditColorScheme.xaml | 19 +++++++++++---- .../Resources/en-US/Resources.resw | 12 ++++++++++ .../GlobalAppSettings.cpp | 24 +++++++++++++++++++ .../TerminalSettingsModel/GlobalAppSettings.h | 1 + .../GlobalAppSettings.idl | 1 + 11 files changed, 82 insertions(+), 5 deletions(-) diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.cpp b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.cpp index b0278f5fcc6..db83a1553b2 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.cpp +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.cpp @@ -131,6 +131,14 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation } } + void ColorSchemeViewModel::Duplicate_Click(const IInspectable& /*sender*/, const Windows::UI::Xaml::RoutedEventArgs& /*e*/) + { + if (const auto parentPageVM{ _parentPageVM.get() }) + { + return parentPageVM.RequestDuplicateCurrentScheme(); + } + } + void ColorSchemeViewModel::DeleteConfirmation_Click(const IInspectable& /*sender*/, const Windows::UI::Xaml::RoutedEventArgs& /*e*/) { if (const auto parentPageVM{ _parentPageVM.get() }) diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h index 19c2e76adf7..96063ca9b57 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h @@ -36,6 +36,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void DeleteConfirmation_Click(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::RoutedEventArgs& e); void SetAsDefault_Click(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::RoutedEventArgs& e); + void Duplicate_Click(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::RoutedEventArgs& e); // DON'T YOU DARE ADD A `WINRT_CALLBACK(PropertyChanged` TO A CLASS DERIVED FROM ViewModelHelper. Do this instead: using ViewModelHelper::PropertyChanged; diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl index 207f7b7c17e..73585e6c80d 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl @@ -27,6 +27,7 @@ namespace Microsoft.Terminal.Settings.Editor void DeleteConfirmation_Click(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args); void SetAsDefault_Click(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args); + void Duplicate_Click(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args); } [default_interface] runtimeclass ColorTableEntry : Windows.UI.Xaml.Data.INotifyPropertyChanged diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp b/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp index 18316cf4ee9..f64d6bdb9de 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp @@ -192,6 +192,24 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation } } + void ColorSchemesPageViewModel::RequestDuplicateCurrentScheme() + { + if (_CurrentScheme) + { + if (auto actualCurrentScheme = _viewModelToSchemeMap.TryLookup(_CurrentScheme)) + { + auto scheme = _settings.GlobalSettings().DuplicateColorScheme(actualCurrentScheme); + // Construct the new color scheme VM + const auto schemeVM{ winrt::make(scheme, *this, _settings) }; + _AllColorSchemes.Append(schemeVM); + _viewModelToSchemeMap.Insert(schemeVM, scheme); + CurrentScheme(schemeVM); + CurrentPage(ColorSchemesSubPage::Base); + RequestEditSelectedScheme(); + } + } + } + bool ColorSchemesPageViewModel::CanDeleteCurrentScheme() const { if (_CurrentScheme) diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.h b/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.h index a3431ed0b10..e559432b78d 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.h +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.h @@ -26,6 +26,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void RequestDeleteCurrentScheme(); void RequestEditSelectedScheme(); void RequestSetSelectedSchemeAsDefault(); + void RequestDuplicateCurrentScheme(); bool CanDeleteCurrentScheme() const; diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.idl b/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.idl index a3afeb63ae9..524cc9dd271 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.idl +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.idl @@ -19,6 +19,7 @@ namespace Microsoft.Terminal.Settings.Editor ColorSchemeViewModel RequestAddNew(); Boolean RequestRenameCurrentScheme(String newName); void RequestDeleteCurrentScheme(); + void RequestDuplicateCurrentScheme(); void RequestEditSelectedScheme(); void RequestSetSelectedSchemeAsDefault(); diff --git a/src/cascadia/TerminalSettingsEditor/EditColorScheme.xaml b/src/cascadia/TerminalSettingsEditor/EditColorScheme.xaml index c98f5c8d6c4..a30606c1e8d 100644 --- a/src/cascadia/TerminalSettingsEditor/EditColorScheme.xaml +++ b/src/cascadia/TerminalSettingsEditor/EditColorScheme.xaml @@ -197,9 +197,18 @@ + + - diff --git a/src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl b/src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl index c271dbcd2a1..21bc4b9c326 100644 --- a/src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl +++ b/src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl @@ -3,7 +3,7 @@ namespace Microsoft.Terminal.Settings.Model { - // This tag is used to identify the context in which the Profile was created + // This tag is used to identify the context in which this object was created enum OriginTag { None = 0, From 8440309b233b184a406f2e51f527bfff3e0bb38f Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Tue, 27 Feb 2024 12:39:02 -0600 Subject: [PATCH 22/30] Track fixups made during load, rather than reverse engineering it --- .../SerializationTests.cpp | 73 +++++++++++++++++++ .../TerminalSettingsModel/CascadiaSettings.h | 1 + .../CascadiaSettingsSerialization.cpp | 7 +- 3 files changed, 77 insertions(+), 4 deletions(-) diff --git a/src/cascadia/LocalTests_SettingsModel/SerializationTests.cpp b/src/cascadia/LocalTests_SettingsModel/SerializationTests.cpp index 29a4155dc17..b4778e8b814 100644 --- a/src/cascadia/LocalTests_SettingsModel/SerializationTests.cpp +++ b/src/cascadia/LocalTests_SettingsModel/SerializationTests.cpp @@ -47,6 +47,7 @@ namespace SettingsModelLocalTests TEST_METHOD(RoundtripUserModifiedColorSchemeCollision); TEST_METHOD(RoundtripUserModifiedColorSchemeCollisionUnusedByProfiles); + TEST_METHOD(RoundtripUserDeletedColorSchemeCollision); private: // Method Description: @@ -863,4 +864,76 @@ namespace SettingsModelLocalTests VERIFY_ARE_EQUAL(toString(newResult), toString(oldResult)); } + + void SerializationTests::RoundtripUserDeletedColorSchemeCollision() + { + static constexpr std::string_view oldSettingsJson{ R"( + { + "defaultProfile": "{6239a42c-0000-49a3-80bd-e8fdd045185c}", + "profiles": [ + { + "name": "profile0", + "guid": "{6239a42c-0000-49a3-80bd-e8fdd045185c}" + } + ], + "schemes": [ + { + "name": "Tango Dark", + "foreground": "#D3D7CF", + "background": "#000000", + "cursorColor": "#FFFFFF", + "black": "#000000", + "red": "#CC0000", + "green": "#4E9A06", + "yellow": "#C4A000", + "blue": "#3465A4", + "purple": "#75507B", + "cyan": "#06989A", + "white": "#D3D7CF", + "brightBlack": "#555753", + "brightRed": "#EF2929", + "brightGreen": "#8AE234", + "brightYellow": "#FCE94F", + "brightBlue": "#729FCF", + "brightPurple": "#AD7FA8", + "brightCyan": "#34E2E2", + "brightWhite": "#EEEEEC" + } + ] + })" }; + + // Key differences: Tango Dark has been deleted, as it was identical to the inbox one. + static constexpr std::string_view newSettingsJson{ R"-( + { + "defaultProfile": "{6239a42c-0000-49a3-80bd-e8fdd045185c}", + "profiles": + { + "list": + [ + { + "name": "profile0", + "guid": "{6239a42c-0000-49a3-80bd-e8fdd045185c}" + } + ] + }, + "actions": [ ], + "schemes": [ ] + })-" }; + + implementation::SettingsLoader oldLoader{ oldSettingsJson, DefaultJson }; + oldLoader.MergeInboxIntoUserSettings(); + oldLoader.FinalizeLayering(); + VERIFY_IS_TRUE(oldLoader.FixupUserSettings(), L"Validate that this will indicate we need to write them back to disk"); + const auto oldSettings = winrt::make_self(std::move(oldLoader)); + const auto oldResult{ oldSettings->ToJson() }; + + implementation::SettingsLoader newLoader{ newSettingsJson, DefaultJson }; + newLoader.MergeInboxIntoUserSettings(); + newLoader.FinalizeLayering(); + newLoader.FixupUserSettings(); + const auto newSettings = winrt::make_self(std::move(newLoader)); + const auto newResult{ newSettings->ToJson() }; + + VERIFY_ARE_EQUAL(toString(newResult), toString(oldResult)); + } } diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettings.h b/src/cascadia/TerminalSettingsModel/CascadiaSettings.h index 5bdfaf60ed9..4180c8d8c38 100644 --- a/src/cascadia/TerminalSettingsModel/CascadiaSettings.h +++ b/src/cascadia/TerminalSettingsModel/CascadiaSettings.h @@ -46,6 +46,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation std::unordered_map> profilesByGuid; std::unordered_map> colorSchemes; std::unordered_map colorSchemeRemappings; + bool fixupsAppliedDuringLoad{ false }; void clear(); }; diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp index faea01922bc..e3796a9b7d6 100644 --- a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp +++ b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp @@ -114,6 +114,7 @@ void ParsedSettings::clear() profiles.clear(); profilesByGuid.clear(); colorSchemes.clear(); + fixupsAppliedDuringLoad = false; } // This is a convenience method used by the CascadiaSettings constructor. @@ -464,10 +465,7 @@ bool SettingsLoader::FixupUserSettings() CommandlinePatch{ DEFAULT_WINDOWS_POWERSHELL_GUID, L"powershell.exe", L"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" }, }; - auto fixedUp = false; - - // If any color schemes had to be remapped, we need to re-save the settings. - fixedUp = !userSettings.colorSchemeRemappings.empty() || fixedUp; + auto fixedUp = userSettings.fixupsAppliedDuringLoad; fixedUp = RemapColorSchemeForProfile(userSettings.baseLayerProfile) || fixedUp; for (const auto& profile : userSettings.profiles) @@ -871,6 +869,7 @@ void SettingsLoader::_addOrMergeUserColorScheme(const winrt::com_ptrOrigin() == OriginTag::User) // we only want to impose ordering on User schemes { it->second = newScheme; // Stomp the user's existing scheme with the one we just got (to make sure the right Origin is set) + userSettings.fixupsAppliedDuringLoad = true; // Make sure we save the settings. if (!existingScheme->IsEquivalentForSettingsMergePurposes(newScheme)) { hstring newName{ fmt::format(FMT_COMPILE(L"{} (modified)"), existingScheme->Name()) }; From 07831f841d3ed7f065e593b56f4b422354b13c93 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Tue, 27 Feb 2024 12:43:20 -0600 Subject: [PATCH 23/30] Really everyone should be using pwsh --- build/pipelines/templates-v2/job-run-pgo-tests.yml | 1 + build/pipelines/templates-v2/job-test-project.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/build/pipelines/templates-v2/job-run-pgo-tests.yml b/build/pipelines/templates-v2/job-run-pgo-tests.yml index 817d97ff9ce..f4208bf9553 100644 --- a/build/pipelines/templates-v2/job-run-pgo-tests.yml +++ b/build/pipelines/templates-v2/job-run-pgo-tests.yml @@ -56,6 +56,7 @@ jobs: - task: PowerShell@2 displayName: 'Run PGO Tests' inputs: + pwsh: true targetType: filePath filePath: build\scripts\Run-Tests.ps1 arguments: >- diff --git a/build/pipelines/templates-v2/job-test-project.yml b/build/pipelines/templates-v2/job-test-project.yml index 1cd8e2bef67..5c53d76cfd0 100644 --- a/build/pipelines/templates-v2/job-test-project.yml +++ b/build/pipelines/templates-v2/job-test-project.yml @@ -44,6 +44,7 @@ jobs: - task: PowerShell@2 displayName: 'Run Unit Tests' inputs: + pwsh: true targetType: filePath filePath: build\scripts\Run-Tests.ps1 arguments: -MatchPattern '*unit.test*.dll' -Platform '$(OutputBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(Terminal.BinDir)" @@ -52,6 +53,7 @@ jobs: - task: PowerShell@2 displayName: 'Run Feature Tests' inputs: + pwsh: true targetType: filePath filePath: build\scripts\Run-Tests.ps1 arguments: -MatchPattern '*feature.test*.dll' -Platform '$(OutputBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(Terminal.BinDir)" From b4ba76c7d13d9bf9455bdb7c71f4b492a15f9c79 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Tue, 27 Feb 2024 13:15:21 -0600 Subject: [PATCH 24/30] Change the namespace, change the world --- src/cascadia/TerminalSettingsModel/ActionMap.h | 8 ++++---- src/cascadia/TerminalSettingsModel/Command.h | 6 +++--- src/cascadia/TerminalSettingsModel/GlobalAppSettings.h | 2 +- src/cascadia/TerminalSettingsModel/Profile.h | 10 +++++----- src/cascadia/TerminalSettingsModel/TerminalSettings.h | 4 ++-- .../UnitTests_SettingsModel/ColorSchemeTests.cpp | 7 +------ src/cascadia/UnitTests_SettingsModel/CommandTests.cpp | 7 +------ .../UnitTests_SettingsModel/DeserializationTests.cpp | 7 +------ .../UnitTests_SettingsModel/KeyBindingsTests.cpp | 7 +------ .../UnitTests_SettingsModel/NewTabMenuTests.cpp | 7 +------ src/cascadia/UnitTests_SettingsModel/ProfileTests.cpp | 7 +------ .../UnitTests_SettingsModel/SerializationTests.cpp | 7 +------ .../UnitTests_SettingsModel/TerminalSettingsTests.cpp | 7 +------ src/cascadia/UnitTests_SettingsModel/ThemeTests.cpp | 7 +------ 14 files changed, 24 insertions(+), 69 deletions(-) diff --git a/src/cascadia/TerminalSettingsModel/ActionMap.h b/src/cascadia/TerminalSettingsModel/ActionMap.h index d59dc0677d8..937d79f66cb 100644 --- a/src/cascadia/TerminalSettingsModel/ActionMap.h +++ b/src/cascadia/TerminalSettingsModel/ActionMap.h @@ -20,7 +20,7 @@ Author(s): #include "Command.h" // fwdecl unittest classes -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { class KeyBindingsTests; class DeserializationTests; @@ -123,8 +123,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation // than is necessary to be serialized. std::unordered_map _MaskingActions; - friend class SettingsModelLocalTests::KeyBindingsTests; - friend class SettingsModelLocalTests::DeserializationTests; - friend class SettingsModelLocalTests::TerminalSettingsTests; + friend class SettingsModelUnitTests::KeyBindingsTests; + friend class SettingsModelUnitTests::DeserializationTests; + friend class SettingsModelUnitTests::TerminalSettingsTests; }; } diff --git a/src/cascadia/TerminalSettingsModel/Command.h b/src/cascadia/TerminalSettingsModel/Command.h index 4418716c815..a432fe9a370 100644 --- a/src/cascadia/TerminalSettingsModel/Command.h +++ b/src/cascadia/TerminalSettingsModel/Command.h @@ -25,7 +25,7 @@ Author(s): #include "SettingsTypes.h" // fwdecl unittest classes -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { class DeserializationTests; class CommandTests; @@ -87,8 +87,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation static std::vector _expandCommand(Command* const expandable, Windows::Foundation::Collections::IVectorView profiles, Windows::Foundation::Collections::IVectorView schemes); - friend class SettingsModelLocalTests::DeserializationTests; - friend class SettingsModelLocalTests::CommandTests; + friend class SettingsModelUnitTests::DeserializationTests; + friend class SettingsModelUnitTests::CommandTests; }; } diff --git a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.h b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.h index 21d73483c02..79f40342254 100644 --- a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.h +++ b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.h @@ -27,7 +27,7 @@ Author(s): #include "RemainingProfilesEntry.h" // fwdecl unittest classes -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { class DeserializationTests; class ColorSchemeTests; diff --git a/src/cascadia/TerminalSettingsModel/Profile.h b/src/cascadia/TerminalSettingsModel/Profile.h index 1414dc0be1d..6fdd5c3ed57 100644 --- a/src/cascadia/TerminalSettingsModel/Profile.h +++ b/src/cascadia/TerminalSettingsModel/Profile.h @@ -54,7 +54,7 @@ Author(s): #include "FontConfig.h" // fwdecl unittest classes -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { class DeserializationTests; class ProfileTests; @@ -147,10 +147,10 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation winrt::hstring _evaluateIcon() const; - friend class SettingsModelLocalTests::DeserializationTests; - friend class SettingsModelLocalTests::ProfileTests; - friend class SettingsModelLocalTests::ColorSchemeTests; - friend class SettingsModelLocalTests::KeyBindingsTests; + friend class SettingsModelUnitTests::DeserializationTests; + friend class SettingsModelUnitTests::ProfileTests; + friend class SettingsModelUnitTests::ColorSchemeTests; + friend class SettingsModelUnitTests::KeyBindingsTests; friend class TerminalAppUnitTests::DynamicProfileTests; friend class TerminalAppUnitTests::JsonTests; }; diff --git a/src/cascadia/TerminalSettingsModel/TerminalSettings.h b/src/cascadia/TerminalSettingsModel/TerminalSettings.h index 0e7346a5960..22fba938723 100644 --- a/src/cascadia/TerminalSettingsModel/TerminalSettings.h +++ b/src/cascadia/TerminalSettingsModel/TerminalSettings.h @@ -25,7 +25,7 @@ using IFontFeatureMap = winrt::Windows::Foundation::Collections::IMap; // fwdecl unittest classes -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { class TerminalSettingsTests; } @@ -182,7 +182,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation const Windows::Foundation::Collections::IMapView& schemes, const winrt::Microsoft::Terminal::Settings::Model::Theme currentTheme); - friend class SettingsModelLocalTests::TerminalSettingsTests; + friend class SettingsModelUnitTests::TerminalSettingsTests; }; } diff --git a/src/cascadia/UnitTests_SettingsModel/ColorSchemeTests.cpp b/src/cascadia/UnitTests_SettingsModel/ColorSchemeTests.cpp index 4fc5db560d6..b2198160671 100644 --- a/src/cascadia/UnitTests_SettingsModel/ColorSchemeTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/ColorSchemeTests.cpp @@ -16,13 +16,8 @@ using namespace WEX::Logging; using namespace WEX::TestExecution; using namespace WEX::Common; -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { - // TODO:microsoft/terminal#3838: - // Unfortunately, these tests _WILL NOT_ work in our CI. We're waiting for - // an updated TAEF that will let us install framework packages when the test - // package is deployed. Until then, these tests won't deploy in CI. - class ColorSchemeTests : public JsonTestClass { TEST_CLASS(ColorSchemeTests); diff --git a/src/cascadia/UnitTests_SettingsModel/CommandTests.cpp b/src/cascadia/UnitTests_SettingsModel/CommandTests.cpp index 659e205e0b1..f68b0224a47 100644 --- a/src/cascadia/UnitTests_SettingsModel/CommandTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/CommandTests.cpp @@ -15,13 +15,8 @@ using namespace WEX::Logging; using namespace WEX::TestExecution; using namespace WEX::Common; -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { - // TODO:microsoft/terminal#3838: - // Unfortunately, these tests _WILL NOT_ work in our CI. We're waiting for - // an updated TAEF that will let us install framework packages when the test - // package is deployed. Until then, these tests won't deploy in CI. - class CommandTests : public JsonTestClass { TEST_CLASS(CommandTests); diff --git a/src/cascadia/UnitTests_SettingsModel/DeserializationTests.cpp b/src/cascadia/UnitTests_SettingsModel/DeserializationTests.cpp index c4bc4271e7b..e546cf3305e 100644 --- a/src/cascadia/UnitTests_SettingsModel/DeserializationTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/DeserializationTests.cpp @@ -19,13 +19,8 @@ using namespace winrt::Microsoft::Terminal::Settings::Model; using namespace winrt::Microsoft::Terminal::Control; using VirtualKeyModifiers = winrt::Windows::System::VirtualKeyModifiers; -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { - // TODO:microsoft/terminal#3838: - // Unfortunately, these tests _WILL NOT_ work in our CI. We're waiting for - // an updated TAEF that will let us install framework packages when the test - // package is deployed. Until then, these tests won't deploy in CI. - class DeserializationTests : public JsonTestClass { TEST_CLASS(DeserializationTests); diff --git a/src/cascadia/UnitTests_SettingsModel/KeyBindingsTests.cpp b/src/cascadia/UnitTests_SettingsModel/KeyBindingsTests.cpp index 97c34c44d45..8eed7276f1b 100644 --- a/src/cascadia/UnitTests_SettingsModel/KeyBindingsTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/KeyBindingsTests.cpp @@ -17,13 +17,8 @@ using namespace WEX::TestExecution; using namespace WEX::Common; using VirtualKeyModifiers = winrt::Windows::System::VirtualKeyModifiers; -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { - // TODO:microsoft/terminal#3838: - // Unfortunately, these tests _WILL NOT_ work in our CI. We're waiting for - // an updated TAEF that will let us install framework packages when the test - // package is deployed. Until then, these tests won't deploy in CI. - class KeyBindingsTests : public JsonTestClass { TEST_CLASS(KeyBindingsTests); diff --git a/src/cascadia/UnitTests_SettingsModel/NewTabMenuTests.cpp b/src/cascadia/UnitTests_SettingsModel/NewTabMenuTests.cpp index 48065021505..d5bc0a75161 100644 --- a/src/cascadia/UnitTests_SettingsModel/NewTabMenuTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/NewTabMenuTests.cpp @@ -18,13 +18,8 @@ using namespace WEX::Logging; using namespace WEX::TestExecution; using namespace WEX::Common; -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { - // TODO:microsoft/terminal#3838: - // Unfortunately, these tests _WILL NOT_ work in our CI. We're waiting for - // an updated TAEF that will let us install framework packages when the test - // package is deployed. Until then, these tests won't deploy in CI. - class NewTabMenuTests : public JsonTestClass { TEST_CLASS(NewTabMenuTests); diff --git a/src/cascadia/UnitTests_SettingsModel/ProfileTests.cpp b/src/cascadia/UnitTests_SettingsModel/ProfileTests.cpp index f7948744dd4..047d3c89cfb 100644 --- a/src/cascadia/UnitTests_SettingsModel/ProfileTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/ProfileTests.cpp @@ -15,13 +15,8 @@ using namespace WEX::Logging; using namespace WEX::TestExecution; using namespace WEX::Common; -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { - // TODO:microsoft/terminal#3838: - // Unfortunately, these tests _WILL NOT_ work in our CI. We're waiting for - // an updated TAEF that will let us install framework packages when the test - // package is deployed. Until then, these tests won't deploy in CI. - class ProfileTests : public JsonTestClass { TEST_CLASS(ProfileTests); diff --git a/src/cascadia/UnitTests_SettingsModel/SerializationTests.cpp b/src/cascadia/UnitTests_SettingsModel/SerializationTests.cpp index 77820a3337a..252c72dd7d4 100644 --- a/src/cascadia/UnitTests_SettingsModel/SerializationTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/SerializationTests.cpp @@ -16,13 +16,8 @@ using namespace WEX::Common; using namespace winrt::Microsoft::Terminal::Settings::Model; using namespace winrt::Microsoft::Terminal::Control; -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { - // TODO:microsoft/terminal#3838: - // Unfortunately, these tests _WILL NOT_ work in our CI. We're waiting for - // an updated TAEF that will let us install framework packages when the test - // package is deployed. Until then, these tests won't deploy in CI. - class SerializationTests : public JsonTestClass { TEST_CLASS(SerializationTests); diff --git a/src/cascadia/UnitTests_SettingsModel/TerminalSettingsTests.cpp b/src/cascadia/UnitTests_SettingsModel/TerminalSettingsTests.cpp index 0e893d981d3..9a8b43a4dd5 100644 --- a/src/cascadia/UnitTests_SettingsModel/TerminalSettingsTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/TerminalSettingsTests.cpp @@ -16,13 +16,8 @@ using namespace WEX::Common; using namespace winrt::Microsoft::Terminal::Settings::Model; using namespace winrt::Microsoft::Terminal::Control; -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { - // TODO:microsoft/terminal#3838: - // Unfortunately, these tests _WILL NOT_ work in our CI. We're waiting for - // an updated TAEF that will let us install framework packages when the test - // package is deployed. Until then, these tests won't deploy in CI. - class TerminalSettingsTests { TEST_CLASS(TerminalSettingsTests); diff --git a/src/cascadia/UnitTests_SettingsModel/ThemeTests.cpp b/src/cascadia/UnitTests_SettingsModel/ThemeTests.cpp index 5d8cc6777bb..512d9b20aa5 100644 --- a/src/cascadia/UnitTests_SettingsModel/ThemeTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/ThemeTests.cpp @@ -17,13 +17,8 @@ using namespace WEX::Logging; using namespace WEX::TestExecution; using namespace WEX::Common; -namespace SettingsModelLocalTests +namespace SettingsModelUnitTests { - // TODO:microsoft/terminal#3838: - // Unfortunately, these tests _WILL NOT_ work in our CI. We're waiting for - // an updated TAEF that will let us install framework packages when the test - // package is deployed. Until then, these tests won't deploy in CI. - class ThemeTests : public JsonTestClass { TEST_CLASS(ThemeTests); From aaf802cd3454e8548f8b318ec36b57c6e69355a1 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Tue, 27 Feb 2024 20:40:59 -0600 Subject: [PATCH 25/30] Add support for isolated te.exe to Invoke-Tests --- tools/OpenConsole.psm1 | 12 +++++++++--- tools/tests.xml | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/OpenConsole.psm1 b/tools/OpenConsole.psm1 index 3dd17957161..0f25a8e93a8 100644 --- a/tools/OpenConsole.psm1 +++ b/tools/OpenConsole.psm1 @@ -169,7 +169,7 @@ function Invoke-OpenConsoleTests() [switch]$FTOnly, [parameter(Mandatory=$false)] - [ValidateSet('host', 'interactivityWin32', 'terminal', 'adapter', 'feature', 'uia', 'textbuffer', 'til', 'types', 'terminalCore', 'terminalApp', 'localTerminalApp', 'localSettingsModel', 'unitRemoting', 'unitControl')] + [ValidateSet('host', 'interactivityWin32', 'terminal', 'adapter', 'feature', 'uia', 'textbuffer', 'til', 'types', 'terminalCore', 'terminalApp', 'localTerminalApp', 'unitSettingsModel', 'unitRemoting', 'unitControl')] [string]$Test, [parameter(Mandatory=$false)] @@ -232,13 +232,19 @@ function Invoke-OpenConsoleTests() # run selected tests foreach ($t in $TestsToRun) { + $currentTaefExe = $TaefExePath + if ($t.isolatedTaef -eq "true") + { + $currentTaefExe = (Join-Path (Split-Path (Join-Path $BinDir $t.binary)) "te.exe") + } + if ($t.type -eq "unit") { - & $TaefExePath "$BinDir\$($t.binary)" $TaefArgs + & $currentTaefExe "$BinDir\$($t.binary)" $TaefArgs } elseif ($t.type -eq "ft") { - Invoke-TaefInNewWindow -OpenConsolePath $OpenConsolePath -TaefPath $TaefExePath -TestDll "$BinDir\$($t.binary)" -TaefArgs $TaefArgs + Invoke-TaefInNewWindow -OpenConsolePath $OpenConsolePath -TaefPath $currentTaefExe -TestDll "$BinDir\$($t.binary)" -TaefArgs $TaefArgs } else { diff --git a/tools/tests.xml b/tools/tests.xml index de9bed4f1d9..4301c09b2a3 100644 --- a/tools/tests.xml +++ b/tools/tests.xml @@ -5,7 +5,7 @@ - + From 2a0c20ec347463bbbbd891e935ce221086d5bfbf Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Tue, 27 Feb 2024 20:46:52 -0600 Subject: [PATCH 26/30] Add support for isolated te.exe to runut too (sheesh) --- tools/runut.cmd | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/runut.cmd b/tools/runut.cmd index 3d6c97db92b..abe63498416 100644 --- a/tools/runut.cmd +++ b/tools/runut.cmd @@ -13,7 +13,7 @@ if "%PLATFORM%" == "Win32" ( set _TestHostAppPath=%OPENCON%\bin\%_LAST_BUILD_CONF%\TestHostApp ) -call %TAEF% ^ +%TAEF% ^ %OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\Conhost.Unit.Tests.dll ^ %OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\TextBuffer.Unit.Tests.dll ^ %OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_TerminalCore\Terminal.Core.Unit.Tests.dll ^ @@ -25,7 +25,17 @@ call %TAEF% ^ %OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_TerminalApp\Terminal.App.Unit.Tests.dll ^ %OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_Remoting\Remoting.Unit.Tests.dll ^ %OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_Control\Control.Unit.Tests.dll ^ - %OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_SettingsModel\SettingsModel.Unit.Tests.dll ^ %_TestHostAppPath%\TerminalApp.LocalTests.dll ^ %* +set _EarlyTestFail=%ERRORLEVEL% + +%OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_SettingsModel\te.exe ^ + %OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_SettingsModel\SettingsModel.Unit.Tests.dll ^ + %* + +if %_EarlyTestFail% NEQ 0 ( + exit %_EarlyTestFail% +) + +exit %ERRORLEVEL% From 860a78e56315ea307d7691b4172860ff541c7a64 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Wed, 28 Feb 2024 12:35:59 -0600 Subject: [PATCH 27/30] this is /bImportant --- tools/runut.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/runut.cmd b/tools/runut.cmd index abe63498416..62614d15d94 100644 --- a/tools/runut.cmd +++ b/tools/runut.cmd @@ -35,7 +35,7 @@ set _EarlyTestFail=%ERRORLEVEL% %* if %_EarlyTestFail% NEQ 0 ( - exit %_EarlyTestFail% + exit /b %_EarlyTestFail% ) -exit %ERRORLEVEL% +exit /b %ERRORLEVEL% From cd655ee7924e16afc20ec6c092cd0d588f226afb Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Wed, 28 Feb 2024 20:34:27 +0100 Subject: [PATCH 28/30] Theoretical fix --- src/cascadia/UnitTests_SettingsModel/TerminalSettingsTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/UnitTests_SettingsModel/TerminalSettingsTests.cpp b/src/cascadia/UnitTests_SettingsModel/TerminalSettingsTests.cpp index 9a8b43a4dd5..f45fd1624f7 100644 --- a/src/cascadia/UnitTests_SettingsModel/TerminalSettingsTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/TerminalSettingsTests.cpp @@ -140,7 +140,7 @@ namespace SettingsModelUnitTests g.Data4[7]); } - const auto tmpdir = std::filesystem::temp_directory_path(); + const auto tmpdir = std::filesystem::canonical(std::filesystem::temp_directory_path()); const auto dir1 = tmpdir / guid; const auto dir2 = tmpdir / (guid + L" two"); const auto file1 = dir1 / L"file 1.exe"; From aebf73d673efb8eff5ee8c19e3758a337597ae28 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Thu, 29 Feb 2024 09:59:59 -0600 Subject: [PATCH 29/30] fix the icon check in the Profile test --- src/cascadia/TerminalSettingsModel/Profile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cascadia/TerminalSettingsModel/Profile.cpp b/src/cascadia/TerminalSettingsModel/Profile.cpp index f31cd4e85f7..0db012e7bc7 100644 --- a/src/cascadia/TerminalSettingsModel/Profile.cpp +++ b/src/cascadia/TerminalSettingsModel/Profile.cpp @@ -317,7 +317,11 @@ Json::Value Profile::ToJson() const JsonUtils::SetValueForKey(json, GuidKey, writeBasicSettings ? Guid() : _Guid); JsonUtils::SetValueForKey(json, HiddenKey, writeBasicSettings ? Hidden() : _Hidden); JsonUtils::SetValueForKey(json, SourceKey, writeBasicSettings ? Source() : _Source); - JsonUtils::SetValueForKey(json, IconKey, writeBasicSettings ? Icon() : _Icon); + + // Recall: Icon isn't actually a setting in the MTSM_PROFILE_SETTINGS. We + // defined it manually in Profile, so make sure we only serialize the Icon + // if the user actually changed it here. + JsonUtils::SetValueForKey(json, IconKey, (writeBasicSettings && HasIcon()) ? Icon() : _Icon); // PermissiveStringConverter is unnecessary for serialization JsonUtils::SetValueForKey(json, PaddingKey, _Padding); From 0a9099bf0e47ce63b1cf6f51d9ba40b7468b67b1 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Thu, 29 Feb 2024 10:09:07 -0600 Subject: [PATCH 30/30] you know what, more tests I'm here --- .../SerializationTests.cpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/cascadia/UnitTests_SettingsModel/SerializationTests.cpp b/src/cascadia/UnitTests_SettingsModel/SerializationTests.cpp index 252c72dd7d4..c75da633ac2 100644 --- a/src/cascadia/UnitTests_SettingsModel/SerializationTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/SerializationTests.cpp @@ -199,9 +199,34 @@ namespace SettingsModelUnitTests "source": "local" })" }; + static constexpr std::string_view profileWithIcon{ R"( + { + "guid" : "{8b039d4d-77ca-5a83-88e1-dfc8e895a127}", + "name": "profileWithIcon", + "hidden": false, + "icon": "foo.png" + })" }; + static constexpr std::string_view profileWithNullIcon{ R"( + { + "guid" : "{8b039d4d-77ca-5a83-88e1-dfc8e895a127}", + "name": "profileWithNullIcon", + "hidden": false, + "icon": null + })" }; + static constexpr std::string_view profileWithNoIcon{ R"( + { + "guid" : "{8b039d4d-77ca-5a83-88e1-dfc8e895a127}", + "name": "profileWithNoIcon", + "hidden": false, + "icon": "none" + })" }; + RoundtripTest(profileString); RoundtripTest(smallProfileString); RoundtripTest(weirdProfileString); + RoundtripTest(profileWithIcon); + RoundtripTest(profileWithNullIcon); + RoundtripTest(profileWithNoIcon); } void SerializationTests::ColorScheme()