build(detekt): Ignore FunctionNaming for Composable functions - #6176
Merged
Merged
Conversation
Compose functions that emit UI are PascalCase by convention, which detekt's default FunctionNaming pattern flags. Follow detekt's Compose guide and skip the rule for @composable functions. Fixes JAVA-748 Fixes #6175 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
📲 Install BuildsAndroid
|
runningcode
marked this pull request as ready for review
September 28, 2026 12:09
runningcode
requested review from
0xadam-brown,
adinauer,
markushi and
romtsn
as code owners
September 28, 2026 12:09
This was referenced Sep 28, 2026
runningcode
added a commit
that referenced
this pull request
Sep 28, 2026
Add the rest of detekt's Compose guide on top of the FunctionNaming change from #6176. Keep accepting SCREAMING_CASE top-level constants, because the guide's PascalCase-only pattern would flag every existing TRACE_ORIGIN-style constant. Refs JAVA-748 Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Configure detekt's
FunctionNamingrule to ignore@Composablefunctions, as recommended by detekt's Compose guide.💡 Motivation and Context
Composables that emit UI are PascalCase by convention (e.g.
SentryTraced,SentryUserFeedbackButton), which detekt's default[a-z][a-zA-Z0-9]*pattern flags.Using
ignoreAnnotatedrather than looseningfunctionPatternkeeps the lowercase rule in force for all non-Composable functions.💚 How did you test it?
./gradlew :sentry-compose:detektAndroidReleaseno longer reportsFunctionNamingforSentryUserFeedbackButton,SentryTraced, andProvideSentrySpan; the other findings are unchanged.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
We should probably do the rest of the guide too.
#skip-changelog