Fix Quality Gate CI: dead detekt action + non-observable locale#10
Merged
Conversation
Lint's NonObservableLocale flagged Locale.getDefault() inside a composable: timestamps would not re-format when the user changed system locale. Use LocalLocale.current.platformLocale and remember the formatter so it is not rebuilt on every recomposition. This was the sole error failing the Android Lint job. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The detekt job never ran: detekt/detekt-action no longer exists on GitHub (404), so it failed during "Set up job" every time. Run the official detekt CLI jar instead, pinned to the 1.23.8 already in the version catalog. That exposed a detekt.yml that was invalid for 1.23.8 (renamed ComplexMethod, deprecated ForbiddenComment values/customMessage, excludedFunctions as a comma-string) — fatal under warningsAsErrors. Also correct two rules that were misconfigured rather than strict: FunctionNaming used excludeClassPattern, which does not exclude @composable functions (ignoreAnnotated does), and MagicNumber fired on the HCT tone tables and tensor normalization constants, where the literals are the domain. Remaining 258 findings are recorded in detekt-baseline.xml so new code is gated while the existing debt stays tracked. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mechanical ktlint pass: indentation, argument-list wrapping, trailing whitespace, import ordering, unused imports, final newlines. No behavioural change; compileDebugKotlin passes. Clears ~700 of the findings the detekt job would have reported. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
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.
The Quality Gate workflow has failed on every push for weeks. There were two independent causes, plus a config that had never been exercised.
1. Detekt job — the action was deleted
detekt/detekt-action@v2no longer exists on GitHub (hard 404), so the job died in ~2s during Set up job. It never ran a single check. Replaced with the official detekt CLI jar, pinned to the1.23.8already in the version catalog.Because detekt had never actually run, turning it on surfaced 1310 issues against a
maxIssues: 0gate. Worked down as follows:detekt.ymlwas also invalid for 1.23.8 (renamedComplexMethod, deprecatedForbiddenComment.values/customMessage,excludedFunctionsas a comma-string) — fatal underwarningsAsErrors: true.Two rules were misconfigured rather than strict:
FunctionNamingflagged 100@Composablefunctions — the config usedexcludeClassPattern, which doesn't do that;ignoreAnnotateddoes.MagicNumberfired onColorSchemes(HCT tone tables) andImageOps(tensor normalization means/stds), where the literals are the domain. Naming 218 of them would obscure the math.The gate is verified real, not green-by-default: injecting a
printStackTrace+ magic number into a scratch file fails at exit 2; removing it passes at exit 0.2. Android Lint job — a real bug
HistoryScreen.kt:286readLocale.getDefault()inside a composable (NonObservableLocale), so history timestamps would not re-format when the user changed system locale. Now usesLocalLocale.current.platformLocale, with theSimpleDateFormathoisted into aremember.Verified locally
./gradlew lint→ BUILD SUCCESSFUL (was: 1 error)./gradlew compileDebugKotlin→ BUILD SUCCESSFUL (confirms the 87-file format pass is safe)Reviewing
Read it commit-by-commit — the two real fixes are isolated from the formatting churn, which is
style: apply detekt --auto-correctand is behaviour-free.Follow-up
The 258 baselined findings are real debt — notably 20
SwallowedException, the kind that hides bugs. Worth burning down separately.🤖 Generated with Claude Code