Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/azsdk-cli/Azure.Sdk.Tools.Cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Bugs Fixed

- Fixed case insensitivity with ward ScanPaths in package validation readme tool

### Other Changes

## 0.5.11 (2026-01-05)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ public async Task<PackageCheckResponse> ValidateChangelog(
var timeout = TimeSpan.FromMinutes(5);
var processResult = await _processHelper.Run(new(command, args, timeout: timeout, workingDirectory: packagePath), ct);

if (processResult.ExitCode != 0)
{
_logger.LogWarning("Changelog validation failed. Exit Code: {ExitCode}, Output: {Output}",
processResult.ExitCode, processResult.Output);
return new PackageCheckResponse(processResult.ExitCode, processResult.Output, "Changelog validation failed.");
}

return new PackageCheckResponse(processResult);
}
catch (Exception ex)
Expand Down Expand Up @@ -150,16 +157,31 @@ public async Task<PackageCheckResponse> ValidateReadme(
return new PackageCheckResponse(1, "", $"Doc settings file not found at expected location: {settingsPath}");
}

// TODO: investigate doc-warden code, this normalizes package path for Scan Paths
var normalizedPackagePath = Path.GetFullPath(packagePath);
// Ensure drive letter is uppercase on Windows for consistency
if (OperatingSystem.IsWindows() && normalizedPackagePath.Length >= 2)
{
normalizedPackagePath = char.ToUpperInvariant(normalizedPackagePath[0]) + normalizedPackagePath.Substring(1);
}

var command = "pwsh";
var args = new[] {
"-File", scriptPath,
"-SettingsPath", settingsPath,
"-ScanPaths", packagePath,
"-ScanPaths", normalizedPackagePath,
};

var timeout = TimeSpan.FromMinutes(10);
var processResult = await _processHelper.Run(new(command, args, timeout: timeout, workingDirectory: packagePath), ct);

if (processResult.ExitCode != 0)
{
_logger.LogWarning("Readme validation failed. Exit Code: {ExitCode}, Output: {Output}",
processResult.ExitCode, processResult.Output);
return new PackageCheckResponse(processResult.ExitCode, processResult.Output, "Readme validation failed.");
}

return new PackageCheckResponse(processResult);
}
catch (Exception ex)
Expand Down Expand Up @@ -218,6 +240,13 @@ public async Task<PackageCheckResponse> CheckSpelling(
}
}

if (processResult.ExitCode != 0)
{
_logger.LogWarning("Spelling check failed. Exit Code: {ExitCode}, Output: {Output}",
processResult.ExitCode, processResult.Output);
return new PackageCheckResponse(processResult.ExitCode, processResult.Output, "Spelling check failed.");
}

return new PackageCheckResponse(processResult);
}
catch (Exception ex)
Expand Down