Skip to content

Replace manual #copy with standard #dup#889

Merged
amomchilov merged 1 commit intomainfrom
Alex/replace-manual-copy-with-dup
Apr 2, 2026
Merged

Replace manual #copy with standard #dup#889
amomchilov merged 1 commit intomainfrom
Alex/replace-manual-copy-with-dup

Conversation

@amomchilov
Copy link
Copy Markdown
Contributor

No description provided.

@amomchilov amomchilov added the chore Chore task label Apr 1, 2026
def allowed_extensions=(_arg0); end

sig { returns(::Spoom::Sorbet::Config) }
def copy; end
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this considered a breaking change? Is this API public?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Go ahead and break it 👍

@amomchilov amomchilov marked this pull request as ready for review April 1, 2026 20:11
@amomchilov amomchilov requested a review from a team as a code owner April 1, 2026 20:11
@amomchilov amomchilov self-assigned this Apr 1, 2026
@amomchilov
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

new_config.no_stdlib = @no_stdlib
new_config
#: (Config source) -> void
def initialize_copy(source)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, otherwise the dup has shallow-copy semantics (arrays are shared). This makes it a deep copy (which is how #copy behaved).

@amomchilov amomchilov requested a review from Morriar April 1, 2026 20:55
def allowed_extensions=(_arg0); end

sig { returns(::Spoom::Sorbet::Config) }
def copy; end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Go ahead and break it 👍

@amomchilov amomchilov added the breaking-change Change breaking retro-compatibility label Apr 2, 2026
@amomchilov amomchilov merged commit 31ec3a5 into main Apr 2, 2026
13 checks passed
@amomchilov amomchilov deleted the Alex/replace-manual-copy-with-dup branch April 2, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Change breaking retro-compatibility chore Chore task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants