Skip to content

Commit

Permalink
Add SkippedSupport opt-in annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
drewhamilton committed Dec 11, 2024
1 parent 1884e8c commit cc619fd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ package dev.drewhamilton.poko
* Primary constructor properties marked with this annotation will be omitted from generated
* `equals`, `hashCode`, and `toString` functions, as if they were not properties.
*
* This annotation has no effect on properties declared outside of the primary constructor.
* This annotation has no effect on properties declared outside the primary constructor.
*/
@SkippedSupport
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.PROPERTY)
public annotation class Skipped
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package dev.drewhamilton.poko

/**
* Denotes an experimental API that enables the ability to skip a Poko class primary constructor property when
* generating Poko functions.
*/
@RequiresOptIn
public annotation class SkippedSupport

/**
* Denotes an API that enables support for array content reading, which is experimental and may
* change or break.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package poko

import dev.drewhamilton.poko.Poko
import dev.drewhamilton.poko.Skipped
import dev.drewhamilton.poko.SkippedSupport

@OptIn(SkippedSupport::class)
@Suppress("Unused")
@Poko class SkippedProperty(
val id: String,
Expand Down
2 changes: 2 additions & 0 deletions poko-tests/src/commonMain/kotlin/poko/SkippedProperty.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package poko

import dev.drewhamilton.poko.Poko
import dev.drewhamilton.poko.Skipped
import dev.drewhamilton.poko.SkippedSupport

@OptIn(SkippedSupport::class)
@Suppress("Unused")
@Poko class SkippedProperty(
val id: String,
Expand Down

0 comments on commit cc619fd

Please sign in to comment.