Skip to content

Commit 8878878

Browse files
authored
Updated spotless
1 parent 505c02e commit 8878878

File tree

1,739 files changed

+6742
-5410
lines changed

Some content is hidden

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

1,739 files changed

+6742
-5410
lines changed

build.gradle.kts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
kotlin("jvm") version "2.0.21"
33
jacoco
44
id("org.sonarqube") version "5.1.0.4882"
5-
id("com.diffplug.spotless") version "6.12.0"
5+
id("com.diffplug.spotless") version "6.21.0"
66
`maven-publish`
77
}
88

@@ -52,9 +52,14 @@ spotless {
5252
kotlin {
5353
encoding("UTF-8")
5454
target("**/src/**/*.kt")
55-
ktlint("0.43.0").userData(mapOf(
56-
"max_line_length" to "120"
57-
))
55+
ktlint("0.50.0").editorConfigOverride(
56+
mapOf(
57+
"max_line_length" to "120",
58+
"indent_size" to "4",
59+
"ktlint_standard_package-name" to "disabled",
60+
"ktlint_standard_comment-wrapping" to "disabled"
61+
)
62+
)
5863
toggleOffOn()
5964
trimTrailingWhitespace()
6065
endWithNewline()

pom-central.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
<plugin>
110110
<groupId>org.jetbrains.dokka</groupId>
111111
<artifactId>dokka-maven-plugin</artifactId>
112-
<version>1.9.20</version>
112+
<version>2.0.0-Beta</version>
113113
<executions>
114114
<execution>
115115
<phase>prepare-package</phase>

src/main/kotlin/com_github_leetcode/Employee.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ class Employee(
66
/** the importance value of this employee */
77
var importance: Int,
88
/** the id of direct subordinates */
9-
var subordinates: List<Int> = listOf()
9+
var subordinates: List<Int> = listOf(),
1010
)

src/main/kotlin/g0001_0100/s0005_longest_palindromic_substring/Solution.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ class Solution {
1919
var lpsCenter = 0
2020
var lpsRadius = 0
2121
for (i in newStr.indices) {
22-
dp[i] = if (friendCenter + friendRadius > i) Math.min(
23-
dp[friendCenter * 2 - i],
24-
friendCenter + friendRadius - i
25-
) else 1
22+
dp[i] = if (friendCenter + friendRadius > i) {
23+
Math.min(
24+
dp[friendCenter * 2 - i],
25+
friendCenter + friendRadius - i,
26+
)
27+
} else {
28+
1
29+
}
2630
while (i + dp[i] < newStr.size && i - dp[i] >= 0 && newStr[i + dp[i]] == newStr[i - dp[i]]) {
2731
dp[i]++
2832
}

src/main/kotlin/g0001_0100/s0010_regular_expression_matching/Solution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Solution {
3131
i,
3232
j - 2,
3333
s,
34-
p
34+
p,
3535
)
3636
}
3737
} else {

src/main/kotlin/g0001_0100/s0017_letter_combinations_of_a_phone_number/Solution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Solution {
1919
nums: String,
2020
letters: Array<String>,
2121
curr: StringBuilder,
22-
ans: MutableList<String>
22+
ans: MutableList<String>,
2323
) {
2424
if (curr.length == nums.length) {
2525
ans.add(curr.toString())

src/main/kotlin/g0001_0100/s0023_merge_k_sorted_lists/Solution.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ class Solution {
1919
fun mergeKLists(lists: Array<ListNode>): ListNode? {
2020
return if (lists.isEmpty()) {
2121
null
22-
} else mergeKLists(lists, 0, lists.size)
22+
} else {
23+
mergeKLists(lists, 0, lists.size)
24+
}
2325
}
2426

2527
private fun mergeKLists(lists: Array<ListNode>, leftIndex: Int, rightIndex: Int): ListNode? {

src/main/kotlin/g0001_0100/s0030_substring_with_concatenation_of_all_words/Solution.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class Solution {
2020
// move a word's length each time
2121
var j = i
2222
while (j + window <= s.length) {
23-
2423
// get the subStr
2524
val subStr = s.substring(j, j + window)
2625
val map: MutableMap<String, Int> = HashMap()

src/main/kotlin/g0001_0100/s0040_combination_sum_ii/Solution.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Solution {
1919
target: Int,
2020
start: Int,
2121
sums: MutableList<List<Int>>,
22-
sum: LinkedList<Int>
22+
sum: LinkedList<Int>,
2323
) {
2424
if (target == 0) {
2525
// make a deep copy of the current combination
@@ -28,7 +28,6 @@ class Solution {
2828
}
2929
var i = start
3030
while (i < candidates.size && target >= candidates[i]) {
31-
3231
// If candidate[i] equals candidate[i-1], then solutions for i is subset of
3332
// solution of i-1
3433
if (i == start || i > start && candidates[i] != candidates[i - 1]) {

src/main/kotlin/g0001_0100/s0046_permutations/Solution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Solution {
1919
nums: IntArray,
2020
finalResult: MutableList<List<Int>>,
2121
currResult: MutableList<Int>,
22-
used: BooleanArray
22+
used: BooleanArray,
2323
) {
2424
if (currResult.size == nums.size) {
2525
finalResult.add(ArrayList(currResult))

0 commit comments

Comments
 (0)