Skip to content

Conversation

aSemy
Copy link
Contributor

@aSemy aSemy commented Jun 9, 2024

  • Remove @OptIn(ExperimentalStdlibApi::class) now that Ranges are stable
  • @Suppress("UNCHECKED_CAST") when casting ranges
  • Use @PublishedApi instead of @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE").
  • Update ABI dumps, because @PublishedApi are technically part of the public ABI.
  • Update kdoc to fix typos.
  • Remove If you need to check for empty range, use [ClosedRange.shouldBeEmpty] from kdoc - no such function exists.

- Remove `@OptIn(ExperimentalStdlibApi::class)` now that Ranges are stable
- `@Suppress("UNCHECKED_CAST")` when casting ranges
- Use `@PublishedApi` instead of `@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")`.
- Update kdoc to fix typos.
- Remove `If you need to check for empty range, use [ClosedRange.shouldBeEmpty]` from kdoc - no such function exists.
@aSemy aSemy marked this pull request as draft June 9, 2024 09:20
@aSemy aSemy marked this pull request as ready for review June 9, 2024 09:24
Copy link
Contributor Author

@aSemy aSemy Jun 9, 2024

Choose a reason for hiding this comment

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

I thought I could annotate the @PublishedApi functions with @KotestInternal to avoid updating the ABI dumps, but I see that @KotestInternal isn't excluded from the ABI dumps. Shouldn't it be?

kotest/build.gradle.kts

Lines 13 to 21 in d4fc582

apiValidation {
ignoredPackages.addAll(
listOf(
"io.kotest.framework.multiplatform.embeddablecompiler",
"io.kotest.framework.multiplatform.gradle",
"io.kotest.framework.multiplatform.native"
)
)
}

Copy link
Member

Choose a reason for hiding this comment

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

AFAIK there's no way to exclude API with a particular annotation. Or is it?

Copy link
Contributor Author

@aSemy aSemy Jun 9, 2024

Choose a reason for hiding this comment

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

There is:

apiValidation {
    /**
     * Set of annotations that exclude API from being public.
     * Typically, it is all kinds of `@InternalApi` annotations that mark
     * effectively private API that cannot be actually private for technical reasons.
     */
    nonPublicMarkers.add("my.package.MyInternalApiAnnotation")
}

Copy link
Member

Choose a reason for hiding this comment

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

Oh, alright. Lets add that IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed! I think it's a good idea

Copy link
Member

Choose a reason for hiding this comment

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

Created separate issue for tracking that. Do you want to proceed with that before finishing up this PR, or should we look into merging this one as-is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, thanks.

Let's merge this one as-is.

(this.end.edgeType== RangeEdgeType.INCLUSIVE && other.start.edgeType == RangeEdgeType.INCLUSIVE) -> (endOfThis < startOfOther)
else -> (endOfThis <= startOfOther)
(this.end.edgeType == RangeEdgeType.INCLUSIVE && other.start.edgeType == RangeEdgeType.INCLUSIVE) -> (endOfThis < startOfOther)
else -> (endOfThis <= startOfOther)
Copy link
Member

Choose a reason for hiding this comment

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

What formatting rule is this? I don't think it's one we typically apply in this project :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh oops, I must have used my default formatter! I enabled 'align when branches in columns'.

Thanks for checking, I'll fix my config.

@Kantis Kantis added this pull request to the merge queue Jun 9, 2024
Merged via the queue into kotest:master with commit 9ecf548 Jun 9, 2024
@aSemy aSemy deleted the fix/tidy-range-matchers branch June 10, 2024 09:29
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