From 25ae70c5bd4dd430620682bf54c7e62f148d2df6 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 22 May 2026 08:33:35 -0400 Subject: [PATCH] =?UTF-8?q?fix(android):=20clear=20detekt=20findings=20?= =?UTF-8?q?=E2=80=94=20rename=20files,=20wrap=20long=20lines,=20allow=20Co?= =?UTF-8?q?mposable=20PascalCase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Seven findings from the first real detekt run: - LocalActionColors.kt / Tokens.kt: MatchingDeclarationName flagged that the file names don't match the single top-level declaration. Renamed to ActionColors.kt and FabledSwordTokens.kt (`git mv`). - Typography.kt: three Font(...) calls exceeded the default 120-char line length. Wrapped each named-arg list onto its own line. - MainActivity.kt + MinstrelTheme.kt: FunctionNaming flagged App() / MinstrelTheme() for not starting lowercase — these are @Composable functions and PascalCase is the Compose convention. Added a config override to the detekt YAML: naming: FunctionNaming: ignoreAnnotated: ['Composable'] Matches every mainstream Compose codebase. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../{LocalActionColors.kt => ActionColors.kt} | 0 .../theme/{Tokens.kt => FabledSwordTokens.kt} | 0 .../fabledsword/minstrel/theme/Typography.kt | 35 ++++++++++++++++--- android/config/detekt.yml | 21 ++++++----- 4 files changed, 42 insertions(+), 14 deletions(-) rename android/app/src/main/java/com/fabledsword/minstrel/theme/{LocalActionColors.kt => ActionColors.kt} (100%) rename android/app/src/main/java/com/fabledsword/minstrel/theme/{Tokens.kt => FabledSwordTokens.kt} (100%) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/theme/LocalActionColors.kt b/android/app/src/main/java/com/fabledsword/minstrel/theme/ActionColors.kt similarity index 100% rename from android/app/src/main/java/com/fabledsword/minstrel/theme/LocalActionColors.kt rename to android/app/src/main/java/com/fabledsword/minstrel/theme/ActionColors.kt diff --git a/android/app/src/main/java/com/fabledsword/minstrel/theme/Tokens.kt b/android/app/src/main/java/com/fabledsword/minstrel/theme/FabledSwordTokens.kt similarity index 100% rename from android/app/src/main/java/com/fabledsword/minstrel/theme/Tokens.kt rename to android/app/src/main/java/com/fabledsword/minstrel/theme/FabledSwordTokens.kt diff --git a/android/app/src/main/java/com/fabledsword/minstrel/theme/Typography.kt b/android/app/src/main/java/com/fabledsword/minstrel/theme/Typography.kt index f48ab4b3..9eafcfba 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/theme/Typography.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/theme/Typography.kt @@ -32,17 +32,42 @@ private val InterFont = GoogleFont("Inter") private val JetBrainsMonoFont = GoogleFont("JetBrains Mono") private val Fraunces = FontFamily( - Font(googleFont = FrauncesFont, fontProvider = GoogleFontProvider, weight = FontWeight.W400, style = FontStyle.Normal), - Font(googleFont = FrauncesFont, fontProvider = GoogleFontProvider, weight = FontWeight.W500, style = FontStyle.Normal), + Font( + googleFont = FrauncesFont, + fontProvider = GoogleFontProvider, + weight = FontWeight.W400, + style = FontStyle.Normal, + ), + Font( + googleFont = FrauncesFont, + fontProvider = GoogleFontProvider, + weight = FontWeight.W500, + style = FontStyle.Normal, + ), ) private val Inter = FontFamily( - Font(googleFont = InterFont, fontProvider = GoogleFontProvider, weight = FontWeight.W400, style = FontStyle.Normal), - Font(googleFont = InterFont, fontProvider = GoogleFontProvider, weight = FontWeight.W500, style = FontStyle.Normal), + Font( + googleFont = InterFont, + fontProvider = GoogleFontProvider, + weight = FontWeight.W400, + style = FontStyle.Normal, + ), + Font( + googleFont = InterFont, + fontProvider = GoogleFontProvider, + weight = FontWeight.W500, + style = FontStyle.Normal, + ), ) private val JetBrainsMono = FontFamily( - Font(googleFont = JetBrainsMonoFont, fontProvider = GoogleFontProvider, weight = FontWeight.W400, style = FontStyle.Normal), + Font( + googleFont = JetBrainsMonoFont, + fontProvider = GoogleFontProvider, + weight = FontWeight.W400, + style = FontStyle.Normal, + ), ) /** diff --git a/android/config/detekt.yml b/android/config/detekt.yml index ae90ff9b..aef9b214 100644 --- a/android/config/detekt.yml +++ b/android/config/detekt.yml @@ -1,10 +1,13 @@ -# Empty detekt config — relies on defaults via `buildUponDefaultConfig = true` -# in the :app detekt {} block. Per-rule overrides go here as needed: +# Per-rule overrides layered on top of detekt's defaults +# (`buildUponDefaultConfig = true` in the :app `detekt {}` block). # -# style: -# MagicNumber: -# active: false -# -# The pre-2.0 `build: maxIssues: 0` top-level was removed; failure -# threshold is configured via the Gradle DSL's `failOnSeverity` option -# instead (defaults to Error). +# The pre-2.0 `build:` top-level was removed; failure-on-finding is +# controlled by the Gradle DSL's `failOnSeverity` option instead. + +naming: + # Composables conventionally use PascalCase function names. Allow it + # by ignoring functions annotated @Composable for the FunctionNaming + # rule. Matches every mainstream Compose codebase. + FunctionNaming: + ignoreAnnotated: + - "Composable"