Skip to content
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

chore: skip coverage check for all deprecated pub fns #1368

Merged
merged 1 commit into from
Dec 25, 2024

Conversation

rami3l
Copy link
Contributor

@rami3l rami3l commented Dec 25, 2024

Copy link

‼️ This code review is generated by a bot. Please verify the content before trusting it.

Here are three observations from the provided git diff output:

  1. Deprecated Functions Marked with @coverage.skip:

    • Many functions across multiple files have been marked as deprecated and are now annotated with @coverage.skip. This suggests that these functions are no longer intended to be used and are excluded from test coverage. For example:
      /// @alert deprecated "Use `FixedArray::makei` instead"
      +/// @coverage.skip
      pub fn FixedArray::new[T](length : Int, value : () -> T) -> FixedArray[T] {
      
      This indicates a cleanup effort to phase out old functions and ensure they are not tested, which is a good practice for maintaining code quality.
  2. Inconsistent Deprecation Messages:

    • Some deprecation messages are inconsistent in their phrasing. For example:
      /// @alert deprecated "Use `Buffer::contents` to read the contents of the buffer"
      +/// @coverage.skip
      pub fn to_string(self : T) -> String {
      
      vs.
      /// @alert deprecated "Use `Buffer::contents` to read the contents of the buffer"
      +/// @coverage.skip
      pub fn to_unchecked_string(self : T) -> String {
      
      Both functions have the same deprecation message, but one is to_string and the other is to_unchecked_string. It might be clearer to specify the exact replacement function for each deprecated function.
  3. Redundant Deprecation Annotations:

    • Some functions are marked as deprecated but are already covered by other deprecation annotations. For example:
      /// @alert deprecated "Use `fold` instead"
      +/// @coverage.skip
      pub fn fold_left[T, U](self : FixedArray[T], f : (U, T) -> U, init~ : U) -> U {
      
      This function is deprecated in favor of fold, but similar functions like fold_right, fold_lefti, and fold_righti are also deprecated with the same annotation. This redundancy could be streamlined by grouping related deprecated functions under a single deprecation notice or documentation section.

These observations highlight areas where the codebase could be further improved for clarity and maintainability.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 4320

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+2.2%) to 83.402%

Totals Coverage Status
Change from base Build 4313: 2.2%
Covered Lines: 4623
Relevant Lines: 5543

💛 - Coveralls

@bobzhang bobzhang merged commit 5daca41 into moonbitlang:main Dec 25, 2024
13 checks passed
@rami3l rami3l deleted the chore/deprecate-no-coverage branch December 26, 2024 02:50
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.

3 participants