Skip to content

Commit

Permalink
detekt hint suppress
Browse files Browse the repository at this point in the history
  • Loading branch information
ursjoss committed Mar 23, 2024
1 parent 4439bcf commit ed39a48
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaBasePlugin

@Suppress("unused")
@Suppress("unused", "LackOfCohesionMethods")
class CollectSarifPlugin : Plugin<Project> {

override fun apply(target: Project) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package ch.difty.kris.domain

/**
* A single RIS record. It contains all the allowed tag from RIS format.
* A single RIS record. It contains all the allowed tags from RIS format.
*/
@Suppress("ParameterListWrapping", "SpellCheckingInspection", "TooManyFunctions")
@Suppress("ParameterListWrapping", "SpellCheckingInspection", "TooManyFunctions", "LackOfCohesionMethods")
public data class RisRecord(

/** TY */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import kotlinx.coroutines.flow.flow

private const val INT_INTERMEDIATE = 1000

private val LINE_SEPARATOR = System.getProperty("line.separator")
private val LINE_SEPARATOR = System.lineSeparator()

internal object RisExport {

/**
* Converts a flow of [RisRecord]s into a flow of [String]s in RIS file format.
* Optionally accepts a list of names of [RisTag]s defining a sort order for the [RisTag]s in the file.
*/
@Suppress("OpenClosedPrinciple")
internal fun build(recordFlow: Flow<RisRecord>, sort: List<String> = emptyList()): Flow<String> = flow {
fun RisTag.withValue(value: Any): String = "$this$TAG_SEPARATOR$value$LINE_SEPARATOR"
val sortMap = sort.withIndex().associate { RisTag.valueOf(it.value) to it.index }.toMap()
Expand Down

0 comments on commit ed39a48

Please sign in to comment.