-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug in WRONG_DECLARATIONS_ORDER rule (#1881)
- Fixed new line, which appeared before line with comment. - Added warn and fix tests. Closes #1865
- Loading branch information
1 parent
de959e2
commit 74d62a9
Showing
7 changed files
with
100 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...s/src/test/resources/test/paragraph3/file_structure/CompanionObjectWithCommentExpected.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.saveourtool.diktat | ||
|
||
import io.micrometer.core.instrument.MeterRegistry | ||
import org.springframework.stereotype.Component | ||
|
||
/** | ||
* @param meterRegistry | ||
* @param binRepository | ||
*/ | ||
@Component | ||
class ActiveBinsMetric(meterRegistry: MeterRegistry, private val binRepository: BinRepository) { | ||
companion object { | ||
private const val EGG_4_5_BUCKET_LABEL = "4-5" | ||
private const val EGG_3_BUCKET_LABEL = "3" | ||
private const val EGG_OVER_10_BUCKET_LABEL = "10+" | ||
private const val EGG_7_9_BUCKET_LABEL = "7-9" | ||
private const val DELAY = 15000L | ||
|
||
// 15s | ||
private const val ACTIVE_BINS_METRIC_NAME = "c.concurrent.bins" | ||
private const val NUMBER_OF_EGGS_LABEL = "numberOfEggs" | ||
private const val ALL_ACTIVE_BINS_LABEL = "total" | ||
private const val EGG_2_BUCKET_LABEL = "2" | ||
private const val EGG_1_BUCKET_LABEL = "1" | ||
private val numberOfEggsBuckets = setOf( | ||
EGG_4_5_BUCKET_LABEL, | ||
EGG_2_BUCKET_LABEL, | ||
EGG_3_BUCKET_LABEL, | ||
EGG_7_9_BUCKET_LABEL, | ||
EGG_1_BUCKET_LABEL, | ||
EGG_OVER_10_BUCKET_LABEL, | ||
ALL_ACTIVE_BINS_LABEL) | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...rules/src/test/resources/test/paragraph3/file_structure/CompanionObjectWithCommentTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.saveourtool.diktat | ||
|
||
import io.micrometer.core.instrument.MeterRegistry | ||
import org.springframework.stereotype.Component | ||
|
||
/** | ||
* @param meterRegistry | ||
* @param binRepository | ||
*/ | ||
@Component | ||
class ActiveBinsMetric(meterRegistry: MeterRegistry, private val binRepository: BinRepository) { | ||
companion object { | ||
private const val EGG_4_5_BUCKET_LABEL = "4-5" | ||
private const val EGG_3_BUCKET_LABEL = "3" | ||
private const val EGG_OVER_10_BUCKET_LABEL = "10+" | ||
private const val EGG_7_9_BUCKET_LABEL = "7-9" | ||
private const val DELAY = 15000L | ||
// 15s | ||
private const val ACTIVE_BINS_METRIC_NAME = "c.concurrent.bins" | ||
private const val NUMBER_OF_EGGS_LABEL = "numberOfEggs" | ||
private const val ALL_ACTIVE_BINS_LABEL = "total" | ||
private const val EGG_2_BUCKET_LABEL = "2" | ||
private const val EGG_1_BUCKET_LABEL = "1" | ||
private val numberOfEggsBuckets = setOf( | ||
EGG_4_5_BUCKET_LABEL, | ||
EGG_2_BUCKET_LABEL, | ||
EGG_3_BUCKET_LABEL, | ||
EGG_7_9_BUCKET_LABEL, | ||
EGG_1_BUCKET_LABEL, | ||
EGG_OVER_10_BUCKET_LABEL, | ||
ALL_ACTIVE_BINS_LABEL) | ||
} | ||
} |