Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/azure-cli-core/azure/cli/core/breaking_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ def __init__(self, cli_ctx, *tags):
self.tags = list(tags)

def _get_merged_tag(self):
return ''.join({tag._get_tag(self) for tag in self.tags}) # pylint: disable=protected-access
return ''.join({tag._get_tag(tag) for tag in self.tags}) # pylint: disable=protected-access

def _get_merged_msg(self):
return '\n'.join({tag._get_message(self) for tag in self.tags}) # pylint: disable=protected-access
return '\n'.join({tag._get_message(tag) for tag in self.tags}) # pylint: disable=protected-access
Comment on lines +109 to +112
Copy link

Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

Using a set comprehension here can lead to unpredictable ordering and will drop duplicate tags. If you need to preserve the original order (and possible duplicates), use a list or generator expression, for example: ''.join(tag._get_tag(tag) for tag in self.tags).

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

Similar to the tag merge, this set comprehension will reorder messages and remove duplicates. Consider using \n.join(tag._get_message(tag) for tag in self.tags) to keep the original sequence intact.

Suggested change
return '\n'.join({tag._get_message(tag) for tag in self.tags}) # pylint: disable=protected-access
return '\n'.join(tag._get_message(tag) for tag in self.tags) # pylint: disable=protected-access

Copilot uses AI. Check for mistakes.

super().__init__(cli_ctx, tag.object_type, tag.target, tag_func=_get_merged_tag,
message_func=_get_merged_msg, color=tag._color)
Expand Down