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 JetBrainsMonoFont = GoogleFont("JetBrains Mono")
|
||||||
|
|
||||||
private val Fraunces = FontFamily(
|
private val Fraunces = FontFamily(
|
||||||
Font(googleFont = FrauncesFont, fontProvider = GoogleFontProvider, weight = FontWeight.W400, style = FontStyle.Normal),
|
Font(
|
||||||
Font(googleFont = FrauncesFont, fontProvider = GoogleFontProvider, weight = FontWeight.W500, style = FontStyle.Normal),
|
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(
|
private val Inter = FontFamily(
|
||||||
Font(googleFont = InterFont, fontProvider = GoogleFontProvider, weight = FontWeight.W400, style = FontStyle.Normal),
|
Font(
|
||||||
Font(googleFont = InterFont, fontProvider = GoogleFontProvider, weight = FontWeight.W500, style = FontStyle.Normal),
|
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(
|
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`
|
# Per-rule overrides layered on top of detekt's defaults
|
||||||
# in the :app detekt {} block. Per-rule overrides go here as needed:
|
# (`buildUponDefaultConfig = true` in the :app `detekt {}` block).
|
||||||
#
|
#
|
||||||
# style:
|
# The pre-2.0 `build:` top-level was removed; failure-on-finding is
|
||||||
# MagicNumber:
|
# controlled by the Gradle DSL's `failOnSeverity` option instead.
|
||||||
# active: false
|
|
||||||
#
|
naming:
|
||||||
# The pre-2.0 `build: maxIssues: 0` top-level was removed; failure
|
# Composables conventionally use PascalCase function names. Allow it
|
||||||
# threshold is configured via the Gradle DSL's `failOnSeverity` option
|
# by ignoring functions annotated @Composable for the FunctionNaming
|
||||||
# instead (defaults to Error).
|
# rule. Matches every mainstream Compose codebase.
|
||||||
|
FunctionNaming:
|
||||||
|
ignoreAnnotated:
|
||||||
|
- "Composable"
|
||||||
|
|||||||
Reference in New Issue
Block a user