Skip to content

Commit

Permalink
feat: add worker dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 6, 2023
1 parent 9e5a6fe commit d4179c3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
4 changes: 2 additions & 2 deletions code-quality/src/test/resources/tbs/regression/I18NTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*
* Arduino is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* the Free Software Foundation; either worker 2 of the License, or
* (at your option) any later worker.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ package cc.unitmesh.eval.picker

import org.archguard.action.checkout.GitSourceSettings
import org.archguard.action.checkout.executeGitCheckout
import org.archguard.scanner.analyser.count.LanguageService
import org.jetbrains.annotations.TestOnly
import java.nio.file.Files
import java.nio.file.Path

class CodePicker(val config: PickerConfig) {
private val logger = org.slf4j.LoggerFactory.getLogger(javaClass)
private val languageService = LanguageService()

fun run() {
// 1. check config.url is a valid url or path
val codeDir = checkoutCode(config.url, config.branch, config.baseDir)

// 2. select files to tree
// 2. walkdir select files to tree

// 3. generate tree to jsonl
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package cc.unitmesh.eval.picker.version

import kotlinx.coroutines.CoroutineScope
package cc.unitmesh.eval.picker.worker

abstract class AbstractWorker {
abstract suspend fun start(filePath: String)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cc.unitmesh.eval.picker.version
package cc.unitmesh.eval.picker.worker

import kotlinx.coroutines.coroutineScope
import org.archguard.scanner.analyser.count.FileJob
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package cc.unitmesh.eval.picker.worker

object WorkerDispatch {
/**
* Dispatch language worker by language
*/
fun worker(language: String): AbstractWorker? {
return when (language) {
"Java" -> JavaFileWorker()
else -> null
}
}
}

0 comments on commit d4179c3

Please sign in to comment.