Skip to content

build(detekt): Ignore FunctionNaming for Composable functions - #6176

Merged
runningcode merged 1 commit into
mainfrom
no/java-748-compose-detekt-function-naming
Sep 28, 2026
Merged

runningcode merged 1 commit into
mainfrom
no/java-748-compose-detekt-function-naming

Conversation

@runningcode

@runningcode runningcode commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Configure detekt's FunctionNaming rule to ignore @Composable functions, 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 ignoreAnnotated rather than loosening functionPattern keeps the lowercase rule in force for all non-Composable functions.

💚 How did you test it?

./gradlew :sentry-compose:detektAndroidRelease no longer reports FunctionNaming for SentryUserFeedbackButton, SentryTraced, and ProvideSentrySpan; the other findings are unchanged.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

We should probably do the rest of the guide too.

#skip-changelog

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>
@linear-code

linear-code Bot commented Sep 28, 2026

Copy link
Copy Markdown

JAVA-748

@sentry

sentry Bot commented Sep 28, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.58.0 (1) release

⚙️ sentry-android Build Distribution Settings

@runningcode
runningcode marked this pull request as ready for review September 28, 2026 12:09

@0xadam-brown 0xadam-brown left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@runningcode
runningcode merged commit 893cf0a into main Sep 28, 2026
74 of 80 checks passed
@runningcode
runningcode deleted the no/java-748-compose-detekt-function-naming branch September 28, 2026 12:11
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compose named funcitons trigger a detekt warning

2 participants