This commit is contained in:
bxdxnn
2026-08-24 20:09:11 +00:00
1876 changed files with 20567 additions and 8738 deletions
@@ -57,16 +57,16 @@ class KonsistClassNameTest {
}
@Test
fun `Classes extending 'PreviewParameterProvider' name MUST end with 'Provider' and MUST contain provided class name`() {
fun `Classes extending 'PreviewParameterProvider' name MUST end with 'PreviewParam' and MUST contain provided class name`() {
Konsist.scopeFromProduction()
.classes()
.withAllParentsOf(PreviewParameterProvider::class)
.withoutName(
"AspectRatioProvider",
"EditableAvatarViewUriProvider",
"LoginModeViewErrorProvider",
"OverlapRatioProvider",
"TextFileContentProvider",
"AspectRatioPreviewParam",
"EditableAvatarViewUriPreviewParam",
"LoginModeViewErrorPreviewParam",
"OverlapRatioPreviewParam",
"TextFileContentPreviewParam",
)
.also {
// Check that classes are actually found
@@ -82,8 +82,7 @@ class KonsistClassNameTest {
.removeSuffix("?")
.replace(".", "")
val name = klass.name
name.endsWith("Provider") &&
name.endsWith("PreviewProvider").not() &&
name.endsWith("PreviewParam") &&
name.contains(providedType)
}
}
@@ -104,6 +103,7 @@ class KonsistClassNameTest {
"FakeImageLoader",
"FakeKeyStore",
"FakeListenableFuture",
"FakeParentNode",
)
.assertTrue {
val interfaceName = it.name
@@ -23,24 +23,6 @@ class KonsistLicenseTest {
\*/
""".trimIndent().toRegex()
private val enterpriseLicense = """
/\*
\* © 20\d\d((, |-)20\d\d)? Element Creations Ltd\.
(?:.*\n)* \*
\* Element Creations Ltd, Element Software SARL, Element Software Inc\.,
\* and Element Software GmbH \(the "Element Group"\) only make this file available
\* under a proprietary license model\.
\*
\* Without a proprietary license with us, you cannot use this file\. The terms of
\* the proprietary license agreement between you and any member of the Element Group
\* shall always apply to your use of this file\. Unauthorised use, copying, distribution,
\* or modification of this file, via any medium, is strictly prohibited\.
\*
\* For details about the licensing terms, you must either visit our website or contact
\* a member of our sales team\.
\*/
""".trimIndent().toRegex()
@Test
fun `assert that FOSS files have the correct license header`() {
Konsist
@@ -60,19 +42,6 @@ class KonsistLicenseTest {
}
}
@Test
fun `assert that Enterprise files have the correct license header`() {
Konsist
.scopeFromProject()
.files
.filter {
it.moduleName.startsWith("enterprise")
}
.assertTrue {
enterpriseLicense.containsMatchIn(it.text)
}
}
@Test
fun `assert that files do not have double license header`() {
Konsist
@@ -98,6 +98,7 @@ class KonsistPreviewTest {
"HomeTopBarSpaceFiltersSelectedPreview",
"HomeTopBarSpacesPreview",
"HomeTopBarWithIndicatorPreview",
"HomeTopBarWithStatusPreview",
"IconsOtherPreview",
"MarkdownTextComposerEditPreview",
"MatrixBadgeAtomInfoPreview",