8000 Group builtin deprecated functions by bobzhang · Pull Request #2375 · moonbitlang/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Group builtin deprecated functions #2375

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

Merged

Conversation

bobzhang
Copy link
Contributor

Summary

  • move deprecated functions from various builtin files to deprecated.mbt
  • keep each module tidy with deprecated APIs in one place

Testing

  • moon info
  • moon fmt
  • moon check
  • moon test

https://chatgpt.com/codex/tasks/task_e_685f8b700bb483209327d1dbb4b2ed8e

8000
Copy link
peter-jerry-ye-code-review bot commented Jun 28, 2025
Incomplete documentation fragment in deprecated code

Category
Maintainability
Code Snippet
Line 244-246 in deprecated.mbt:
///|
/// Search the index of the first element that satisfies the predicate.
///
Recommendation
Remove this incomplete documentation fragment or complete it with proper content. Since this appears to be a leftover from the move operation, it should be cleaned up.
Reasoning
This incomplete documentation fragment serves no purpose and clutters the deprecated code file. It appears to be accidentally left behind during the code movement process.

Test function moved to deprecated file unnecessarily

Category
Maintainability
Code Snippet
Lines in deprecated.mbt (moved from string.mbt):
test "substring/basic" {
let s = "hello, world"
inspect(s.substring(start=0, end=5), content="hello")
inspect(s.substring(start=7, end=12), content="world")
inspect(s.substring(), content="hello, world")
}
Recommendation
Move test functions back to their original files or to dedicated test files. Test functions should not be in the deprecated.mbt file as they are not deprecated APIs.
Reasoning
Test functions are not deprecated APIs and should remain with the actual implementation or in dedicated test files. Placing tests in deprecated.mbt makes the codebase harder to maintain and understand.

Inconsistent documentation formatting in moved functions

Category
Correctness
Code Snippet
Lines 151-158 in deprecated.mbt:
///|
/// positions.
///
/// Parameters:
Recommendation
Complete or fix the truncated documentation. The comment should start with a proper description like '/// Shifts the byte value left by the specified number of positions.'
Reasoning
The documentation for Byte::lsl function appears to be incomplete, starting with 'positions.' which suggests the beginning was cut off during the move operation. This makes the API documentation unclear and unhelpful.

@coveralls
Copy link
Collaborator
coveralls commented Jun 28, 2025

Pull Request Test Coverage Report for Build 131

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 89.361%

Totals Coverage Status
Change from base Build 130: 0.0%
Covered Lines: 3452
Relevant Lines: 3863

💛 - Coveralls

@bobzhang bobzhang enabled auto-merge (rebase) June 28, 2025 08:18
@bobzhang bobzhang force-pushed the 5eq7ow-codex/group-deprecated-functions-into-deprecated.mbt branch from 0bdaaa8 to 5950e27 Compare June 28, 2025 08:19
@bobzhang bobzhang merged commit 593ea32 into main Jun 28, 2025
10 checks passed
@bobzhang bobzhang deleted the 5eq7ow-codex/group-deprecated-functions-into-deprecated.mbt branch June 28, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0