Skip to content

Commit

Permalink
Suppress detekt warnings in files instead of baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
markocic committed Dec 10, 2024
1 parent 5b086ea commit 6106cc9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 0 additions & 4 deletions app/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues>
<ID>ComplexCondition:NostrResources.kt$isNote() || isNoteUri() || isNEventUri() || isNEvent()</ID>
<ID>ComplexCondition:RemoteImage.kt$painterIntrinsicSize != null &amp;&amp; painterIntrinsicSize.isSpecified &amp;&amp; painterIntrinsicSize.width != Float.POSITIVE_INFINITY &amp;&amp; painterIntrinsicSize.height != Float.POSITIVE_INFINITY</ID>
<ID>CyclomaticComplexMethod:ArticleDetailsScreen.kt$@OptIn(ExperimentalLayoutApi::class) @Composable private fun ArticleContentWithComments( state: ArticleDetailsContract.UiState, articleParts: List&lt;ArticlePartRender&gt;, listState: LazyListState = rememberLazyListState(), paddingValues: PaddingValues, onArticleCommentClick: (naddr: String) -&gt; Unit, onArticleHashtagClick: (hashtag: String) -&gt; Unit, onZapOptionsClick: () -&gt; Unit, noteCallbacks: NoteCallbacks, onGoToWallet: () -&gt; Unit, onPostAction: ((FeedPostAction) -&gt; Unit)? = null, onPostLongPressAction: ((FeedPostAction) -&gt; Unit)? = null, onFollowUnfollowClick: (() -&gt; Unit)? = null, onUiError: ((UiError) -&gt; Unit)? = null, )</ID>
<ID>CyclomaticComplexMethod:ArticleDetailsScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable private fun ArticleDetailsScreen( detailsState: ArticleDetailsContract.UiState, articleState: ArticleContract.UiState, detailsEventPublisher: (UiEvent) -&gt; Unit, articleEventPublisher: (ArticleContract.UiEvent) -&gt; Unit, onArticleHashtagClick: (hashtag: String) -&gt; Unit, noteCallbacks: NoteCallbacks, onGoToWallet: () -&gt; Unit, onClose: () -&gt; Unit, )</ID>
<ID>CyclomaticComplexMethod:ChatScreen.kt$@Composable private fun ChatMessageListItem( chatMessage: ChatMessageUi, previousMessage: ChatMessageUi? = null, nextMessage: ChatMessageUi? = null, onUrlClick: (String) -&gt; Unit, noteCallbacks: NoteCallbacks, )</ID>
Expand All @@ -13,7 +12,6 @@
<ID>CyclomaticComplexMethod:FeedListViewModel.kt$FeedListViewModel$private fun observeEvents()</ID>
<ID>CyclomaticComplexMethod:FeedNoteCard.kt$@Composable private fun FeedNote( data: FeedPostUi, fullWidthContent: Boolean, avatarSizeDp: Dp, avatarPaddingValues: PaddingValues, notePaddingValues: PaddingValues, enableTweetsMode: Boolean, headerSingleLine: Boolean, showReplyTo: Boolean, forceContentIndent: Boolean, expanded: Boolean, textSelectable: Boolean, showNoteStatCounts: Boolean, noteCallbacks: NoteCallbacks, onPostAction: ((FeedPostAction) -&gt; Unit)? = null, onPostLongClickAction: ((FeedPostAction) -&gt; Unit)? = null, contentFooter: @Composable () -&gt; Unit = {}, )</ID>
<ID>CyclomaticComplexMethod:FeedNoteCard.kt$@ExperimentalMaterial3Api @Composable private fun FeedNoteCard( data: FeedPostUi, state: NoteContract.UiState, eventPublisher: (UiEvent) -&gt; Unit, modifier: Modifier = Modifier, shape: Shape = CardDefaults.shape, colors: CardColors = noteCardColors(), cardPadding: PaddingValues = PaddingValues(all = 0.dp), enableTweetsMode: Boolean = false, headerSingleLine: Boolean = true, fullWidthContent: Boolean = false, forceContentIndent: Boolean = false, drawLineAboveAvatar: Boolean = false, drawLineBelowAvatar: Boolean = false, expanded: Boolean = false, textSelectable: Boolean = false, showReplyTo: Boolean = true, noteOptionsMenuEnabled: Boolean = true, showNoteStatCounts: Boolean = true, noteCallbacks: NoteCallbacks = NoteCallbacks(), onGoToWallet: (() -&gt; Unit)? = null, contentFooter: @Composable () -&gt; Unit = {}, )</ID>
<ID>CyclomaticComplexMethod:MarkdownRichText.kt$private fun computeRichTextString(astNode: AstNode): RichTextString</ID>
<ID>CyclomaticComplexMethod:MessagesRemoteMediator.kt$MessagesRemoteMediator$override suspend fun load(loadType: LoadType, state: PagingState&lt;Int, DirectMessage&gt;): MediatorResult</ID>
<ID>CyclomaticComplexMethod:NostrUserText.kt$@Composable fun NostrUserText( displayName: String, internetIdentifier: String?, modifier: Modifier = Modifier, displayNameColor: Color = AppTheme.colorScheme.onSurface, fontSize: TextUnit = TextUnit.Unspecified, style: TextStyle = LocalTextStyle.current, overflow: TextOverflow = TextOverflow.Ellipsis, maxLines: Int = 1, internetIdentifierBadgeSize: Dp = 14.dp, internetIdentifierBadgeAlign: PlaceholderVerticalAlign = PlaceholderVerticalAlign.Center, customBadgeStyle: LegendaryStyle? = null, annotatedStringPrefixBuilder: (AnnotatedString.Builder.() -&gt; Unit)? = null, annotatedStringSuffixBuilder: (AnnotatedString.Builder.() -&gt; Unit)? = null, )</ID>
<ID>CyclomaticComplexMethod:NoteActionsRow.kt$@Composable fun FeedNoteActionsRow( modifier: Modifier, eventStats: EventStatsUi, isBookmarked: Boolean, highlightedNote: Boolean = false, showBookmark: Boolean = false, showCounts: Boolean = true, onPostAction: ((FeedPostAction) -&gt; Unit)? = null, onPostLongPressAction: ((FeedPostAction) -&gt; Unit)? = null, )</ID>
Expand Down Expand Up @@ -54,7 +52,6 @@
<ID>LongMethod:HomeFeedScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun HomeFeedScreen( state: HomeFeedContract.UiState, onTopLevelDestinationChanged: (PrimalTopLevelDestination) -&gt; Unit, onDrawerScreenClick: (DrawerScreenDestination) -&gt; Unit, onDrawerQrCodeClick: () -&gt; Unit, onSearchClick: () -&gt; Unit, noteCallbacks: NoteCallbacks, onGoToWallet: () -&gt; Unit, onNewPostClick: (content: TextFieldValue?) -&gt; Unit, eventPublisher: (UiEvent) -&gt; Unit, )</ID>
<ID>LongMethod:KeysSettingsScreen.kt$@Composable fun PrivateKeySection(nsec: String)</ID>
<ID>LongMethod:LegendaryProfileCustomizationScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun LegendaryProfileCustomizationScreen( state: LegendaryProfileCustomizationContract.UiState, eventPublisher: (LegendaryProfileCustomizationContract.UiEvent) -&gt; Unit, onClose: () -&gt; Unit, )</ID>
<ID>LongMethod:MarkdownRichText.kt$private fun computeRichTextString(astNode: AstNode): RichTextString</ID>
<ID>LongMethod:MessageConversationListScreen.kt$@Composable private fun ConversationListItem( conversation: MessageConversationUi, onConversationClick: (String) -&gt; Unit, onProfileClick: (profileId: String) -&gt; Unit, )</ID>
<ID>LongMethod:MessageConversationListScreen.kt$@Composable private fun MessagesTabs( relation: ConversationRelation, onFollowsTabClick: () -&gt; Unit, onOtherTabClick: () -&gt; Unit, onMarkAllRead: () -&gt; Unit, )</ID>
<ID>LongMethod:MultipleUserPicker.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun MultipleUserPicker( modifier: Modifier = Modifier, sheetTitle: String, placeholderText: String, onDismissRequest: () -&gt; Unit, onUsersSelected: (Set&lt;UserProfileItemUi&gt;) -&gt; Unit, sheetState: SheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true), startingSelectedUsers: Set&lt;UserProfileItemUi&gt;, )</ID>
Expand Down Expand Up @@ -113,7 +110,6 @@
<ID>MagicNumber:PrimalDrawer.kt$0.5f</ID>
<ID>MagicNumber:PrimalDrawerScaffold.kt$0.5f</ID>
<ID>MatchingDeclarationName:__PrimalIcons.kt$PrimalIcons</ID>
<ID>NestedBlockDepth:MarkdownRichText.kt$private fun computeRichTextString(astNode: AstNode): RichTextString</ID>
<ID>ReturnCount:LnInvoiceUtils.kt$LnInvoiceUtils$private fun getAmount(invoice: String): BigDecimal</ID>
<ID>ReturnCount:MessagesRemoteMediator.kt$MessagesRemoteMediator$override suspend fun load(loadType: LoadType, state: PagingState&lt;Int, DirectMessage&gt;): MediatorResult</ID>
<ID>ReturnCount:NostrResources.kt$private fun String.nostrUriToBytes(): ByteArray?</ID>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("detekt:all")
package net.primal.android.thread.articles.details.ui.richtext

import androidx.compose.foundation.layout.fillMaxWidth
Expand Down Expand Up @@ -31,7 +32,6 @@ import com.halilibo.richtext.ui.string.InlineContent
import com.halilibo.richtext.ui.string.RichTextString
import com.halilibo.richtext.ui.string.Text
import com.halilibo.richtext.ui.string.withFormat
import timber.log.Timber

/**
*
Expand Down Expand Up @@ -94,10 +94,12 @@ private fun computeRichTextString(astNode: AstNode): RichTextString {
}
null
}

is AstEmphasis -> richTextStringBuilder.pushFormat(RichTextString.Format.Italic)
is AstStrikethrough -> richTextStringBuilder.pushFormat(
RichTextString.Format.Strikethrough,
)

is AstImage -> {
richTextStringBuilder.appendInlineContent(
content = InlineContent(
Expand All @@ -115,30 +117,35 @@ private fun computeRichTextString(astNode: AstNode): RichTextString {
)
null
}

is AstLink -> {
Timber.tag("astLink").i(currentNodeType.toString())
richTextStringBuilder.pushFormat(
RichTextString.Format.Link(
destination = currentNodeType.destination,
),
)
}

is AstSoftLineBreak -> {
richTextStringBuilder.append(" ")
null
}

is AstHardLineBreak -> {
richTextStringBuilder.append("\n")
null
}

is AstStrongEmphasis -> richTextStringBuilder.pushFormat(RichTextString.Format.Bold)
is AstText -> {
richTextStringBuilder.append(currentNodeType.literal)
null
}

is AstLinkReferenceDefinition -> richTextStringBuilder.pushFormat(
RichTextString.Format.Link(destination = currentNodeType.destination),
)

else -> null
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("detekt:all")
package net.primal.android.thread.articles.details.ui.richtext

import androidx.compose.foundation.Image
Expand Down

0 comments on commit 6106cc9

Please sign in to comment.