Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thanks for this one, @tkroes. A malformed A few points I would like to discuss with you before we merge. PlatformCop vs LinterCopI tend to place rules by what happens if they're ignored (see how the analyzers differ):
The rule doc justifies with "failed translation loading affects the whole extension". That is the PlatformCop consequence: the platform doesn't apply the translations and users see the base-language captions. It doesn't depend on any Base Application convention, so it isn't ApplicationCop either. It also isn't about procedure bodies, which is what LinterCop inspects. Could you move the rule to PlatformCop with the next free Severity: Warning rather than ErrorThe rule is on by default at Error, so anyone who upgrades ALCops with a malformed Code ReviewSome remarks on the implementaion of the code itself 1. Stream the file instead of building a DOM. private static readonly XmlReaderSettings WellFormedOnly = new()
{
DtdProcessing = DtdProcessing.Prohibit,
XmlResolver = null,
IgnoreComments = true,
IgnoreWhitespace = true,
};
using Stream stream = fileSystem.OpenRead(translationFile);
using var reader = XmlReader.Create(stream, WellFormedOnly);
while (reader.Read())
{
}
2. Discovery only catches catch (DirectoryNotFoundException)
{
return;
}
catch (Exception exception) when (exception is IOException or UnauthorizedAccessException)
{
ReportFileError(ctx, "Translations", $"Unable to enumerate translation files: {exception.Message}");
return;
}... or return silently if you'd rather not report this case. Either way it shouldn't crash. 3. Missing manifest: this rule and LC0091 behave differently. When the app's manifest ( NavAppManifest? manifest;
try
{
manifest = ManifestHelper.GetManifest(ctx.Compilation);
}
catch (FileNotFoundException)
{
manifest = null;
}
if (manifest is not null && !manifest.CompilerFeatures.ShouldGenerateTranslationFile())
return;
string appName = manifest?.AppName ?? string.Empty;TestsI see some errors in |
…o 1.5.1 (ALCops#592) * fix(ci): fail the test job when a test project does not compile Every test step in build-test.yml was continue-on-error, so a compile error in a test project (CS1705 from RoslynTestKit referencing a newer SDK than the leg's floor) produced no trx and was silently skipped; the daily build stayed green for weeks. Each test project is now built in its own step without continue-on-error, so a compile error fails the job at that step. `dotnet test --no-build` (same NavTargetFramework and Configuration, so it runs the exact build output) stays continue-on-error, so test failures still do not stop the remaining cops and AL versions from reporting together. The rules docs now describe the gate and the RoslynTestKit floor contract: the per-TFM floor moves down when Microsoft publishes a net10.0 build for an older AL major, and the remedy for CS1705 is re-pinning and releasing RoslynTestKit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * chore: bump RoslynTestKit to 1.5.1 and pin the local net10.0 SDK to the 16.10 floor RoslynTestKit 1.5.1 compiles its net10.0 lib against SDK 16.10.44.19458, the lowest marketplace net10.0 release, so it binds on every leg at or above the CI compile floor. Setup-BCDevTools.ps1 now pins net10.0 to the same 16.10 VSIX so the local compile floor equals the CI floor. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * chore(ci): name the build steps in the no-trx error and keep the floor doc to current state The no-trx error in Merge Test Results now points at the Build steps as well as the Setup and Run steps. The floor row in get-bc-devtools.md drops its dated history, states the mechanism and current values, and explains why RoslynTestKit must be compiled against an SDK at or below the floor (CS1705). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Look great, thank you! Let's get this merged! 🎉 |
Summary
Adds LinterCop rule PC0039 TranslationFilesMustBeWellFormed to report malformed or unreadable translation files for the current app.
Location.None; XML parse errors include line and columnValidation
dotnet format ALCops.sln --verify-no-changes: clean.clauderule validation: passed/code-review: no significant issues foundDocs-site page in the sibling
alcops.devrepo remains to be written.