Skip to content

Commit

Permalink
Fix detekt failures and rename tests (#1386)
Browse files Browse the repository at this point in the history
Co-authored-by: Ashley Davies <[email protected]>
  • Loading branch information
ashdavies and ashdavies authored Dec 12, 2024
1 parent b78f0b5 commit 81ef6e5
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 11 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ jobs:
env:
GOOGLE_SERVICES: ${{ steps.op-secrets.outputs.GOOGLE_SERVICES }}
- id: gradle
- id: gradle-build
run: ./gradlew build --console=plain

- run: ./gradlew detektAll --continue --console=plain

- id: screenshot-validation
run: ./gradlew validateScreenshotTest --console=plain

Expand All @@ -70,7 +72,7 @@ jobs:
path: "**/build/reports/screenshotTest/preview/debug"

- uses: thollander/actions-comment-pull-request@v3
if: ${{ steps.gradle.outputs.build-scan-url }}
if: ${{ steps.gradle-build.outputs.build-scan-url }}
with:
message: "Build scan published to ${{ steps.gradle.outputs.build-scan-url }}"
comment-tag: build-scan-url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import androidx.compose.runtime.Composable
import io.ashdavies.party.tooling.MaterialPreviewTheme
import io.ashdavies.party.tooling.PreviewDayNight

internal class EventsDetailTest {
internal class EventsDetailTests {

@Composable
@PreviewDayNight
fun EventsDetailPreview() {
private fun EventsDetailPreview() {
MaterialPreviewTheme {
EventsDetail(DroidconBerlin)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import kotlinx.coroutines.flow.flowOf

private val DroidconEvents = listOf(AndroidMakers, DroidconBerlin, DroidconLondon)

internal class EventsListTest {
internal class EventsListTests {

@Composable
@PreviewDayNight
fun EventsListPreview(data: List<Event> = DroidconEvents) {
private fun EventsListPreview(data: List<Event> = DroidconEvents) {
MaterialPreviewTheme {
EventsList(
state = EventsScreen.State(lazyPagingItems(flowOf(PagingData.from(data)))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import io.ashdavies.party.tooling.MaterialPreviewTheme
import io.ashdavies.party.tooling.PreviewDayNight
import kotlinx.collections.immutable.persistentListOf

internal class GalleryListTest {
internal class GalleryScreenTests {

@Composable
@PreviewDayNight
@OptIn(ExperimentalFoundationApi::class)
fun GalleryGridPreview() {
private fun GalleryGridPreview() {
MaterialPreviewTheme {
GalleryGrid(
itemList = persistentListOf(
Expand All @@ -29,7 +29,7 @@ internal class GalleryListTest {

@Composable
@PreviewDayNight
fun GalleryBottomSheetPreview() {
private fun GalleryBottomSheetPreview() {
MaterialPreviewTheme {
GallerySheetContent(eventSink = { })
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class HomeScreenTests {
@Composable
@PreviewDayNight
@OptIn(ExperimentalMaterial3Api::class)
fun HomeTopAppBarPreview() {
private fun HomeTopAppBarPreview() {
MaterialPreviewTheme {
HomeTopBar(
actions = {
Expand All @@ -27,7 +27,7 @@ internal class HomeScreenTests {

@Composable
@PreviewDayNight
fun HomeBottomSheetPreview() {
private fun HomeBottomSheetPreview() {
MaterialPreviewTheme {
HomeBottomBar()
}
Expand Down
2 changes: 2 additions & 0 deletions detekt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ naming:
style:
MagicNumber:
ignorePropertyDeclaration: true
UnusedPrivateMember:
ignoreAnnotated: ['Preview', 'PreviewDayNight']
UnusedPrivateProperty:
excludes:
- '**/*.gradle.kts'

0 comments on commit 81ef6e5

Please sign in to comment.