Skip to content

Commit c86847d

Browse files
authored
Require use of trailing commas at declaration site (#4760)
https://kotlinlang.org/docs/coding-conventions.html#trailing-commas > The Kotlin style guide encourages the use of trailing commas at the declaration site and leaves it at your discretion for the call site. Requiring trailing commas at call site would be nice as well, but will revisit in the future
1 parent f675c2b commit c86847d

File tree

446 files changed

+862
-838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

446 files changed

+862
-838
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ ij_java_use_single_class_imports = true
3838
ij_java_while_brace_force = always
3939

4040
[{*.kts,*.kt}]
41+
ij_kotlin_allow_trailing_comma = true
4142
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
4243
ij_kotlin_name_count_to_use_star_import = 2147483647
4344
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647

detekt-rules/detekt.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,14 @@ formatting:
5757
autoCorrect: true
5858
AnnotationOnSeparateLine:
5959
active: false
60-
autoCorrect: true
6160
AnnotationSpacing:
6261
active: false
63-
autoCorrect: true
6462
ArgumentListWrapping:
6563
active: true
66-
autoCorrect: true
6764
indentSize: 4
6865
maxLineLength: 160
6966
Indentation:
7067
active: true
71-
autoCorrect: true
7268
indentSize: 4
7369
excludes: [ '**/TelemetryDefinitions.kt' ]
7470
MaximumLineLength:
@@ -92,11 +88,13 @@ formatting:
9288
maxLineLength: 160
9389
SpacingBetweenDeclarationsWithComments:
9490
active: true
95-
autoCorrect: true
9691
excludes: [ '**/icons/**' ]
92+
# TrailingCommaOnCallSite:
93+
# active: true
94+
TrailingCommaOnDeclarationSite:
95+
active: true
9796
Wrapping:
9897
active: true
99-
autoCorrect: true
10098
indentSize: 4
10199
maxLineLength: 160
102100

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/auth/AuthController.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class AuthController {
3838
private fun getAuthNeededState(
3939
amazonqConnectionState: ActiveConnection,
4040
codeWhispererConnectionState: ActiveConnection,
41-
onlyIamIdcConnection: Boolean = false
41+
onlyIamIdcConnection: Boolean = false,
4242
): AuthNeededState? =
4343
when (amazonqConnectionState) {
4444
ActiveConnection.NotConnected -> {
@@ -85,7 +85,8 @@ class AuthController {
8585
when (type) {
8686
AuthFollowUpType.MissingScopes,
8787
AuthFollowUpType.Unsupported,
88-
AuthFollowUpType.FullAuth -> runInEdt {
88+
AuthFollowUpType.FullAuth,
89+
-> runInEdt {
8990
UiTelemetry.click(project, "amazonq_chatAuthenticate")
9091
requestCredentialsForQ(project, connectionInitiatedFromQChatPanel = true)
9192
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/auth/AuthNeededState.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ package software.aws.toolkits.jetbrains.services.amazonq.auth
55

66
data class AuthNeededState(
77
val message: String,
8-
val authType: AuthFollowUpType
8+
val authType: AuthFollowUpType,
99
)
1010

1111
data class AuthNeededStates(
1212
val chat: AuthNeededState? = null,
13-
val amazonQ: AuthNeededState? = null
13+
val amazonQ: AuthNeededState? = null,
1414
)

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/gettingstarted/QGettingStartedPanel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import com.intellij.ui.dsl.gridLayout.VerticalAlign
1414
import software.aws.toolkits.jetbrains.utils.isQWebviewsAvailable
1515

1616
class QGettingStartedPanel(
17-
val project: Project
17+
val project: Project,
1818
) : Disposable {
1919
private val webviewContainer = Wrapper()
2020
var browser: QGettingStartedContent? = null

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/onboarding/OnboardingPageInteraction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue
77
import software.aws.toolkits.jetbrains.services.amazonq.messages.AmazonQMessage
88

99
enum class OnboardingPageInteractionType(
10-
@field:JsonValue val json: String
10+
@field:JsonValue val json: String,
1111
) {
1212
CwcButtonClick("onboarding-page-cwc-button-clicked"),
1313
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/toolwindow/AmazonQToolWindow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import javax.swing.JComponent
3434
@Service(Service.Level.PROJECT)
3535
class AmazonQToolWindow private constructor(
3636
private val project: Project,
37-
private val scope: CoroutineScope
37+
private val scope: CoroutineScope,
3838
) : Disposable {
3939
private val appSource = AppSource()
4040
private val browserConnector = BrowserConnector()

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/toolwindow/AmazonQToolWindowFactory.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class AmazonQToolWindowFactory : ToolWindowFactory, DumbAware {
9090

9191
private fun prepareChatContent(
9292
project: Project,
93-
contentManager: ContentManager
93+
contentManager: ContentManager,
9494
): Content {
9595
val component = if (isQConnected(project) && !isQExpired(project)) {
9696
AmazonQToolWindow.getInstance(project).component

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/toolwindow/AmazonQToolWindowListener.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AmazonQToolWindowListener : ToolWindowManagerListener {
1919
override fun stateChanged(
2020
toolWindowManager: ToolWindowManager,
2121
toolWindow: ToolWindow,
22-
changeType: ToolWindowManagerListener.ToolWindowManagerEventType
22+
changeType: ToolWindowManagerListener.ToolWindowManagerEventType,
2323
) {
2424
if (toolWindow.id != AmazonQToolWindowFactory.WINDOW_ID) {
2525
return

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class BrowserConnector(
6363
suspend fun connectTheme(
6464
chatBrowser: CefBrowser,
6565
loginBrowser: CefBrowser,
66-
themeSource: Flow<AmazonQTheme>
66+
themeSource: Flow<AmazonQTheme>,
6767
) = coroutineScope {
6868
themeSource
6969
.distinctUntilChanged()

0 commit comments

Comments
 (0)