Skip to content

Conversation

@options
Copy link
Owner

@options options commented Jun 12, 2025

No description provided.

Copilot AI review requested due to automatic review settings June 12, 2025 19:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces new helper methods for both model shapes and naming conversions.

  • Added two shape retrieval extension methods in SmithyModelExtensions.cs.
  • Introduced a new KebabCase method in NamingUtils.cs to convert strings to kebab-case.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Smithy.Model/SmithyModelExtensions.cs Adds GetShape and GetShape extension methods for retrieving shapes.
Smithy.CSharpGenerator/Utils/NamingUtils.cs Updates formatting in PascalCase and adds a new KebabCase method for string conversion.

Comment on lines +25 to +31

for (int i = 0; i < id.Length; i++)
{
if (i > 0 && char.IsUpper(id[i]))
{
sb.Append('-');
}
Copy link

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider enhancing the KebabCase method to better handle sequences of uppercase letters (e.g., abbreviations like 'XMLHttpRequest') to ensure consistent and expected output, or document the current behavior clearly.

Suggested change
for (int i = 0; i < id.Length; i++)
{
if (i > 0 && char.IsUpper(id[i]))
{
sb.Append('-');
}
bool previousWasUpper = false;
for (int i = 0; i < id.Length; i++)
{
if (char.IsUpper(id[i]))
{
if (i > 0 && !previousWasUpper)
{
sb.Append('-');
}
previousWasUpper = true;
}
else
{
previousWasUpper = false;
}

Copilot uses AI. Check for mistakes.
@options options merged commit c1201cc into master Jun 12, 2025
1 of 4 checks passed
@options options deleted the fix-compile-errors branch June 12, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant