Skip to content

Commit

Permalink
fix(model-api-gen): suppress warnings in generated files
Browse files Browse the repository at this point in the history
Since they are generated there is nothing the user can do to fix these warnings.
  • Loading branch information
slisson committed Jan 28, 2025
1 parent 7737993 commit 50d7b65
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.modelix.metamodel.generator.internal

import com.squareup.kotlinpoet.AnnotationSpec
import com.squareup.kotlinpoet.FileSpec
import java.nio.file.Path

Expand All @@ -10,7 +11,10 @@ internal interface FileGenerator {
val outputDir: Path

fun generateFile() {
generateFileSpec().writeTo(outputDir)
generateFileSpec().toBuilder()
.addAnnotation(AnnotationSpec.builder(Suppress::class).addMember("%S", "warnings").build())
.build()
.writeTo(outputDir)
}

fun generateFileSpec(): FileSpec
Expand Down

0 comments on commit 50d7b65

Please sign in to comment.