mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 16:49:11 +00:00
Add library containing detekt rules for apollo plugins
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
package org.apollo.game.plugin.detekt.rules
|
||||
|
||||
import io.gitlab.arturbosch.detekt.test.lint
|
||||
import java.nio.file.Paths
|
||||
import org.junit.jupiter.api.Assertions.*
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
internal class DeclarationInScriptRuleTest {
|
||||
val rule = DeclarationInScriptRule()
|
||||
|
||||
@Test
|
||||
fun `Finds warning in script file`() {
|
||||
val srcPath = Paths.get(this.javaClass.getResource("/testData/example.kts").toURI())
|
||||
val findings = rule.lint(srcPath)
|
||||
|
||||
assertEquals(1, findings.size)
|
||||
assertEquals("Declaration of ExampleDeclaration should live in a top-level file, not a script", findings[0].message)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class ExampleDeclaration {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user