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

Update lint suppression directives and update jacoco version #84

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@file:Suppress("Unused")

object PublishingVersions {
const val PLUGIN_VERSION = "1.3.0"
const val PLUGIN_GROUP = "com.yelp.codegen"
@Suppress("UNUSED")
const val PLUGIN_ARTIFACT = "plugin"
}
2 changes: 1 addition & 1 deletion plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ java {
}

jacoco {
toolVersion = "0.8.4"
toolVersion = "0.8.5"
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/main/java/com/yelp/codegen/KotlinGenerator.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("TooManyFunctions", "NOTHING_TO_INLINE")

package com.yelp.codegen

import com.google.common.annotations.VisibleForTesting
Expand All @@ -21,6 +19,7 @@ import io.swagger.models.Swagger
import io.swagger.models.properties.Property
import java.io.File

@Suppress("TooManyFunctions")
open class KotlinGenerator : SharedCodegen() {

companion object {
Expand Down Expand Up @@ -374,6 +373,7 @@ open class KotlinGenerator : SharedCodegen() {
/**
* Check if a name is of the type `com.x.name`, which means it has a fully qualified package.
*/
@Suppress("NOTHING_TO_INLINE")
private inline fun String.isFullyQualifiedImportName() = "." in this

override fun postProcessModels(objs: Map<String, Any>): Map<String, Any> {
Expand Down
3 changes: 1 addition & 2 deletions plugin/src/main/java/com/yelp/codegen/SharedCodegen.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("TooManyFunctions")

package com.yelp.codegen

import com.yelp.codegen.utils.InlineModelResolver
Expand Down Expand Up @@ -43,6 +41,7 @@ internal const val X_UNSAFE_OPERATION = "x-unsafe-operation"
internal const val HEADER_X_OPERATION_ID = "X-Operation-ID"
internal const val HEADER_CONTENT_TYPE = "Content-Type"

@Suppress("TooManyFunctions")
abstract class SharedCodegen : DefaultCodegen(), CodegenConfig {

// Reference to the Swagger Specs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.gradle.api.Action
import org.gradle.api.Project
import java.io.File

open class GenerateTaskConfiguration(project: Project) {
open class GenerateTaskConfiguration(@Suppress("UNUSED_PARAMETER") project: Project) {
var platform: String? = null
var packageName: String? = null
var specName: String? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ class PropertyMapEndpointTest {
assertEquals("array_value1", (returned.objectMap?.get("key3") as List<*>)[0])

assertFalse((returned.objectMap?.get("key4") as Map<*, *>).isEmpty())
assertEquals("map_value1", (returned.objectMap?.get("key4") as Map<String, Any>)["map_key1"])
assertEquals(
"map_value1", (
@Suppress("UNCHECKED_CAST")
(returned.objectMap?.get("key4") as Map<String, Any>)
)["map_key1"]
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,13 @@ class XnullablePropertyMapEndpointTest {
assertEquals("array_value1", (returned.objectMap?.get("key3") as List<*>)[0])

assertFalse((returned.objectMap?.get("key4") as Map<*, *>).isEmpty())
assertEquals("map_value1", (returned.objectMap?.get("key4") as Map<String, Any>)["map_key1"])
assertEquals(
"map_value1",
(
@Suppress("UNCHECKED_CAST")
(returned.objectMap?.get("key4") as Map<String, Any>)
)["map_key1"]
)
assertNull(returned.objectMap?.get("key5"))
}
}