mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
PY-73001: improve toml stats, add one more test
GitOrigin-RevId: 177c87c825c8b0da937c23c5b0a9c299ab0fdda5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6675f5d123
commit
56cc278737
@@ -10,7 +10,7 @@ import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.openapi.vfs.findPsiFile
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.psi.search.FileTypeIndex
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import com.intellij.psi.search.ProjectScope
|
||||
import com.jetbrains.python.packaging.PyRequirementParser
|
||||
import org.jetbrains.annotations.ApiStatus.Internal
|
||||
import org.jetbrains.annotations.VisibleForTesting
|
||||
@@ -98,7 +98,7 @@ class PyProjectTomlUsageCollector : ProjectUsagesCollector() {
|
||||
|
||||
return@processFiles true
|
||||
},
|
||||
GlobalSearchScope.allScope(project))
|
||||
ProjectScope.getContentScope(project))
|
||||
|
||||
val metrics = mutableSetOf<MetricEvent>()
|
||||
tools.forEach { name ->
|
||||
|
||||
@@ -29,7 +29,7 @@ class PyProjectTomlStatsTest : PyTestCase() {
|
||||
val text = """
|
||||
some abradackadabra
|
||||
tools.autoflake
|
||||
backend=autoflake
|
||||
requires=autoflake
|
||||
""".trimIndent()
|
||||
|
||||
doTest(text, emptySet(), emptySet())
|
||||
@@ -92,6 +92,19 @@ class PyProjectTomlStatsTest : PyTestCase() {
|
||||
doTest(text, emptySet(), setOf("hatchling", "flit"))
|
||||
}
|
||||
|
||||
fun testCommentedBuilds() {
|
||||
val text = """
|
||||
[build-system]
|
||||
requires = [
|
||||
"hatchling >= 61",
|
||||
# "flit",
|
||||
]
|
||||
build-backend = "xxxxyyy.build"
|
||||
""".trimIndent()
|
||||
|
||||
doTest(text, emptySet(), setOf("hatchling"))
|
||||
}
|
||||
|
||||
fun testNormalizeBuilds() {
|
||||
val text = """
|
||||
[build-system]
|
||||
|
||||
Reference in New Issue
Block a user