Skip to content

refactor: clean up @alert deprecated pragmas #2001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Yoorkin
Copy link
Collaborator

@Yoorkin Yoorkin commented Apr 25, 2025

Clean up pragmas, except for @alert unsafe (requires the #internal attribute).

Copy link

peter-jerry-ye-code-review bot commented Apr 25, 2025

Inconsistent treatment of deprecation notices in interface files

Category
Maintainability
Code Snippet
type ArrayView[T] //deprecated
type Decimal //deprecated
Recommendation
Use the new #deprecated attribute consistently in interface files as well:

#deprecated("use @array.View instead")
type ArrayView[T]

Reasoning
The interface files (.mbti) are using inline comments for deprecation while implementation files (.mbt) use the new #deprecated attribute. This inconsistency makes it harder to programmatically detect deprecated types and may cause confusion.

Missing deprecation messages in interface files

Category
Maintainability
Code Snippet
type Decimal //deprecated
Recommendation
Add the same detailed deprecation message as in the implementation:

#deprecated("Decimal will be changed to private. Use `@strconv.parse_double` instead")
type Decimal

Reasoning
The implementation files contain useful migration guidance in their deprecation messages, but this information is lost in the interface files. Keeping the messages consistent helps developers understand how to migrate away from deprecated APIs.

Missing documentation update for deprecated method

Category
Correctness
Code Snippet
impl Decimal {
#deprecated
from_int64(Int64) -> Self
Recommendation
Add a deprecation message explaining the alternative:

#deprecated("Use parse_double instead")
from_int64(Int64) -> Self

Reasoning
The #deprecated attribute on the from_int64 method lacks a message explaining what developers should use instead. This makes it harder for developers to migrate away from deprecated methods.

@coveralls
Copy link
Collaborator

coveralls commented Apr 25, 2025

Pull Request Test Coverage Report for Build 6457

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.67%

Totals Coverage Status
Change from base Build 6455: 0.0%
Covered Lines: 6119
Relevant Lines: 6603

💛 - Coveralls

@bobzhang bobzhang force-pushed the clean-up-alert-deprecated branch from 8bc52e1 to 5c78825 Compare April 25, 2025 15:52
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.

2 participants