Skip to content

Commit

Permalink
feat(threshold): add basic threshold design
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 19, 2023
1 parent 14b740c commit d3418ae
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ Unit Eval prompt should keep the same structure as the AutoDev prompt. Prompt ex

### Code quality pipeline

Before Check:

- FileSize: 64k
- Complexity: 1000

![Code Quality Workflow](https://unitmesh.cc/uniteval/code-quality-workflow.png)

### Extendable customize quality thresholds
Expand Down
2 changes: 1 addition & 1 deletion docs/quality/threshold.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permalink: /quality/threshold

Default threshold:

- File Size: 64kb, about 640 ~ 1280 lines,
- File Size: 64kb, about 640 ~ 1280 lines, maybe some comments, like chinese
- Complexity: 100,


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import cc.unitmesh.pick.builder.BuilderConfig
import cc.unitmesh.pick.prompt.CodeContextStrategy
import cc.unitmesh.pick.prompt.CompletionBuilderType
import cc.unitmesh.quality.CodeQualityType
import kotlinx.serialization.Serializable

@Serializable
data class WorkerContext(
val codeContextStrategies: List<CodeContextStrategy>,
val qualityTypes: List<CodeQualityType>,
Expand All @@ -13,3 +15,8 @@ data class WorkerContext(
val completionTypes: List<CompletionBuilderType>,
val maxCompletionInOneFile: Int,
)
@Serializable
data class QualityThreshold(
val complexity: Long = 100,
val fileSize: Long = 1024 * 64,
)
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class WorkerManager(workerContext: WorkerContext) {

val language = job.fileSummary.language.toSupportLanguage()
val worker = workers[language] ?: return
logger.info("add file:" + job.fileSummary.location)
// logger.info("add file:" + job.fileSummary.location)
worker.addJob(job)
}

Expand Down

0 comments on commit d3418ae

Please sign in to comment.