Skip to content

Commit

Permalink
style: Add .editorconfig and apply new format
Browse files Browse the repository at this point in the history
  • Loading branch information
guicamest committed Oct 16, 2023
1 parent 8dc4335 commit 2f2796f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
charset = utf-8
trim_trailing_whitespace = true

[*.{kt,kts}]
indent_size = 4
indent_style = space
ij_kotlin_packages_to_use_import_on_demand = unset
ij_kotlin_name_count_to_use_star_import = 999
ij_kotlin_name_count_to_use_star_import_for_members = 999
max_line_length = 110

[*.{yml,yaml}]
indent_size = 2
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ class CoroutinesFindDuplicatesExecution(

override suspend fun duplicateEntries(): Collection<DuplicateGroup> = result.await()

private fun List<Path>.withSameContent() = groupBy { it.contentHash() }.filter { (_, paths) -> paths.size > 1 }
private fun List<Path>.withSameContent() =
groupBy {
it.contentHash()
}.filter { (_, paths) -> paths.size > 1 }

private fun List<Path>.withSameSize() = groupBy { it.fileSize() }.filter { (_, paths) -> paths.size > 1 }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ import kotlinx.coroutines.CoroutineScope
import java.nio.file.Path

class SequentialDuplicateFinder(private val parentScope: CoroutineScope) : DuplicateFinder {
override fun find(directories: Collection<Path>): FindDuplicatesExecution = CoroutinesFindDuplicatesExecution(directories, parentScope)
override fun find(directories: Collection<Path>): FindDuplicatesExecution =
CoroutinesFindDuplicatesExecution(directories, parentScope)
}

0 comments on commit 2f2796f

Please sign in to comment.