kamiazya/scopes
Enhance Konsist rules for broader test framework support
Aperta
#127 aperta il 31 ago 2025
enhancementgood first issuehacktoberfest
Metriche repository
- Star
- (2 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Background
CodeRabbit review of PR #119 suggested several enhancements to our Konsist architecture validation rules to make them more comprehensive and reduce false positives.
Suggested Improvements
DatabaseTestingRulesTest.kt
-
Broaden lifecycle hooks detection
- Support Kotest
beforeSpec/afterSpecand JUnit@BeforeAll/@AfterAll - Recognize
use {}andtry/finallypatterns for resource closing
- Support Kotest
-
Include other SqlDelight drivers
- Support NativeSqliteDriver and AndroidSqliteDriver
- Improve in-memory database detection patterns
-
Better property state detection
- Use anchored regex for var/val detection
- Avoid false positives from comments
EventSourcingArchitectureTest.kt
-
Detect injected clocks
- Support
clock.now()pattern for dependency-injected clocks - Not just
Clock.System.now()
- Support
-
Allow negative test cases
- Permit future timestamps when test explicitly asserts failure
- Detect
shouldThrow,shouldBeLeft, etc.
-
Support virtual time testing
- Recognize TestClock, FixedClock usage
- Support coroutine test utilities
General Improvements
- File-level enforcement instead of per-class for some rules
- Consider DB-level constraints as valid validation strategy
- Narrow scope to domain packages to avoid framework classes
Priority
Low - Current rules work well, these are enhancements for edge cases
Related
- PR #119 (initial Konsist rules implementation)
- Issue #125 (runTest migration)