Skip to content

Commit

Permalink
lintered kotlin files with ktlint v 12.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
scmacdon committed Jun 16, 2024
1 parent 4ec5e80 commit eafe3f1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions kotlin/services/eventbridge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ buildscript {
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.3.0")
classpath("org.jlleitschuh.gradle:ktlint-gradle:12.1.1")
}
}

Expand All @@ -37,7 +37,7 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
}
tasks.withType<KotlinCompile>() {
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
tasks.test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ suspend fun main(args: Array<String>) {
// snippet-start:[eventbridge.kotlin._create_schedule_rule.main]
suspend fun createScRule(
ruleName: String?,
cronExpression: String?
cronExpression: String?,
) {
val ruleRequest =
PutRuleRequest {
Expand All @@ -72,7 +72,7 @@ suspend fun putRuleTarget(
ruleName: String?,
lambdaARN: String,
json: String?,
targetId: String
targetId: String,
) {
val lambdaTarget =
Target {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package com.kotlin.eventbridge

// snippet-start:[eventbridge.kotlin.mvp.main]
import aws.sdk.kotlin.services.eventbridge.EventBridgeClient
import aws.sdk.kotlin.services.eventbridge.model.DeleteRuleRequest
import aws.sdk.kotlin.services.eventbridge.model.DescribeRuleRequest
Expand Down Expand Up @@ -53,7 +54,6 @@ import java.util.Scanner
import java.util.UUID
import kotlin.system.exitProcess

// snippet-start:[eventbridge.kotlin.mvp.main]
/*
Before running this Kotlin code example, set up your development environment,
including your credentials.
Expand Down Expand Up @@ -248,7 +248,7 @@ suspend fun cleanupResources(
topicArn: String?,
eventRuleName: String?,
bucketName: String?,
roleName: String?
roleName: String?,
) {
println("Removing all targets from the event rule.")
deleteTargetsFromRule(eventRuleName)
Expand Down Expand Up @@ -296,7 +296,7 @@ suspend fun deleteS3Bucket(bucketName: String?) {
toDelete.add(
ObjectIdentifier {
key = myValue.key
}
},
)
}
}
Expand Down Expand Up @@ -407,7 +407,7 @@ suspend fun triggerCustomRule(email: String) {
// snippet-start:[eventbridge.kotlin._put_target.custom.transform.main]
suspend fun updateCustomRuleTargetWithTransform(
topicArn: String?,
ruleName: String?
ruleName: String?,
) {
val targetId = UUID.randomUUID().toString()

Expand Down Expand Up @@ -459,7 +459,7 @@ suspend fun updateToCustomRule(ruleName: String?) {
// Update an Amazon S3 object created rule with a transform on the target.
suspend fun updateSnsEventRule(
topicArn: String?,
ruleName: String?
ruleName: String?,
) {
val targetId = UUID.randomUUID().toString()
val myMap = mutableMapOf<String, String>()
Expand Down Expand Up @@ -507,7 +507,7 @@ suspend fun checkRule(eventRuleName: String?) {
// snippet-start:[eventbridge.kotlin.disable.rule.main]
suspend fun changeRuleState(
eventRuleName: String,
isEnabled: Boolean?
isEnabled: Boolean?,
) {
if (!isEnabled!!) {
println("Disabling the rule: $eventRuleName")
Expand Down Expand Up @@ -593,7 +593,7 @@ suspend fun addSnsEventRule(
topicArn: String?,
topicName: String,
eventRuleName: String,
bucketName: String
bucketName: String,
) {
val targetID = UUID.randomUUID().toString()
val myTarget =
Expand Down Expand Up @@ -621,7 +621,7 @@ suspend fun addSnsEventRule(

suspend fun subEmail(
topicArnVal: String?,
email: String?
email: String?,
) {
val request =
SubscribeRequest {
Expand Down Expand Up @@ -691,7 +691,7 @@ suspend fun listRules() {
suspend fun addEventRule(
roleArnVal: String?,
bucketName: String,
eventRuleName: String?
eventRuleName: String?,
) {
val pattern = """{
"source": ["aws.s3"],
Expand Down Expand Up @@ -778,7 +778,7 @@ suspend fun checkBucket(bucketName: String?): Boolean {

suspend fun createIAMRole(
rolenameVal: String?,
polJSON: String?
polJSON: String?,
): String? {
val request =
CreateRoleRequest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

import com.kotlin.eventbridge.listBusesHello
import kotlinx.coroutines.runBlocking
Expand Down

0 comments on commit eafe3f1

Please sign in to comment.