Repository navigation
fix: accept YAML block-scalar trailing line breaks in schema patterns - #6596
lsmlhi_25 (FOWEPJF255) wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.Unrecognized words (1)LWG These words are not needed and should be removedAAD ABCD abi ACL'd AMap Amd appdata ARMNT asan Baz bitmask bluetooth boundparms brk Buf certs cgi CMSG codepage commandline constexpr Cov cswinrt CTL Dbg Dcom decompressor dedupe DEFT devhome Dns dsc EOP ERANGE errcode errmsg errstr filemode Finalizers FULLWIDTH fuzzer GES github Hackathon HINSTANCE hlocal hmac Hyperlink ICONDIR icu idx img inet Intelli iwr JDK LCID lhs LONGLONG LPBYTE LPCWSTR LPDWORD LPSTR LPVOID LPWSTR MAJORVERSION MAXLENGTH maxvalue MDs MINORVERSION mta nlohmann NONAME NOUPDATE NTFS nullability ofile oid oop OPTOUT outfile OUTOFMEMORY PARAMETERMAP pdb PDWORD pid PKCS pkgs pkix placeholders positionals posix pscustomobject pseudocode PSHOST publickey qword redirector regexes remoting reparse REQS rhs rowid RTTI runspace runtimes SARL savepoint Scm sid sqlite subdir subkey trimstart ttl typedef uninitialize uninstallation UNMARSHALING userprofile versioned virtuals Webserver website wildcards winreg WMI workaround Wpp wslTo accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands... in a clone of the git@github.com:FOWEPJF255/winget-cli.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/winget-cli/actions/runs/39055206341/attempts/1' &&
git commit -m 'Update check-spelling metadata'Pattern suggestions ✂️ (2)You could add these patterns to Alternatively, if a pattern suggestion doesn't make sense for this project, add a Notices ℹ️ (1)See the 📂 files view, the 📜action log, or 📝 job summary for details.
See ℹ️ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
Kaleb Luedtke (Trenly)
left a comment
There was a problem hiding this comment.
The upstream PR defines an option to simply recert to multiline matching, why not use that? Or, where the regex check actually takes place, why not specify rhe multiline option?
It feels to me like mutating the strings for each individual occurence would not lead to consistent behaviors
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: > | ||
| https://rubengustorage.blob.core.windows.net/publiccontainer/msixsdk-x86.msi |
There was a problem hiding this comment.
I don’t think this should be using a hardcoded live URL - Don’t other tests use placeholders that get resolved at test runtime?
| { | ||
| { "Arch", [](const YAML::Node& value, const VariantManifestPtr& v)->ValidationErrors { variant_ptr<ManifestInstaller>(v)->Arch = Utility::ConvertToArchitectureEnum(value.as<std::string>()); return {}; } }, | ||
| { "Url", [](const YAML::Node& value, const VariantManifestPtr& v)->ValidationErrors { variant_ptr<ManifestInstaller>(v)->Url = value.as<std::string>(); return {}; } }, | ||
| { "Url", [](const YAML::Node& value, const VariantManifestPtr& v)->ValidationErrors { variant_ptr<ManifestInstaller>(v)->Url = Utility::Trim(value.as<std::string>()); return {}; } }, |
There was a problem hiding this comment.
Applying the trim only to specific fields seems prone to failure. What happens when a new pattern field is added in the future ? The user would have to remember to add the trim?
📖 Description
YAML block scalars that use clip chomping (
>/|) keep one trailing line break. Schemapatterns such asInstallerUrl(^([Hh][Tt][Tt][Pp][Ss]?)://.+$) no longer match that break after the MSVCstd::regexECMAScript change for LWG-2503, so previously valid manifests fail schema validation.This change strips trailing CR/LF from string scalars before schema validation, and trims
InstallerUrl/Urlwhen they are stored. The parsed URL no longer keeps the chomping newline.🔗 References
Resolves #6592
🔍 Validation
Manifest-Good-InstallerUrl-BlockScalar.yamlandReadGoodManifestInstallerUrlBlockScalar, and included the fixture inReadGoodManifests.git diff --checkpassed.AppInstallerCLITestsbuild was not executed in this pass.✅ Checklist
🤖 AI Assistance
AI assistance drafted the trailing-line-break trim, the regression fixture, and this description. The change was reviewed against the issue's
std::regex/ YAML clip-chomping analysis before submission.📋 Issue Type
Microsoft Reviewers: Open in CodeFlow