simon.vergauwen
10/19/2023, 8:30 AMmolikuner
10/20/2023, 12:22 AMgsed -i '/^import io.kotest.core.spec.style.StringSpec$/{c\
import kotlin.test.Test\nimport kotlinx.coroutines.test.runTest
};/^class /s/: StringSpec(//;/^ "/{s/^ "\([^"]\+\)"/\1/ ; s/\([^[:alnum:]]\+\|^\|$\)\([0-9a-zA-Z]\)/\U\2/g ; s/^\(.\)/\l\1/ ; s/^/ @Test fun / ; s/ {$/() = runTest {/};s/^ }$/}/;s/^ \([^@]\)/ \1/;/^)/d' arrow-libs/fx/arrow-fx-stm/src/commonTest/kotlin/arrow/fx/stm/TSemaphoreTest.kt
It does the following
1. Replace the imports (import ordering is off with the current command, and for me spotless doesn’t fix it for some reason. Could be improved or IntelliJ organize import can fix it)
2. Remove the StringSpec inheritance
3. Replace the test names with camel case and add the call to runTest
4. fix the indentation
5. Remove the extra ) at the end of the file
Even though I tried to fix the indentation, it probably makes sense to let IntelliJ auto format the files once before running spotless and committing.
If you want, I can open a PR with such changes 😄simon.vergauwen
10/20/2023, 7:01 AMrunTest(60.seconds) {
but wondering if we should fix those by hand. Also, I think we need to put back some configurations for mocha.
But your script could/would do 95% of the work, so if you can make that happen. Please do 🙏molikuner
10/20/2023, 10:12 AM