fix(android): clear detekt findings — rename files, wrap long lines, allow Composable PascalCase
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
),
|
||||
)
|
||||
|
||||
/**
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user