-
Notifications
You must be signed in to change notification settings - Fork 680
Tidy Range matchers #4081
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
Tidy Range matchers #4081
Conversation
- 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.
There was a problem hiding this comment.
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?
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" | |
) | |
) | |
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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")
}
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.
@OptIn(ExperimentalStdlibApi::class)
now that Ranges are stable@Suppress("UNCHECKED_CAST")
when casting ranges@PublishedApi
instead of@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
.@PublishedApi
are technically part of the public ABI.If you need to check for empty range, use [ClosedRange.shouldBeEmpty]
from kdoc - no such function exists.