Skip to content

Fix Quality Gate CI: dead detekt action + non-observable locale#10

Merged
Azyrn merged 3 commits into
mainfrom
fix/quality-gate-ci
Jul 13, 2026
Merged

Fix Quality Gate CI: dead detekt action + non-observable locale#10
Azyrn merged 3 commits into
mainfrom
fix/quality-gate-ci

Conversation

@Azyrn

@Azyrn Azyrn commented Jul 13, 2026

Copy link
Copy Markdown
Owner

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@v2 no 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 the 1.23.8 already in the version catalog.

Because detekt had never actually run, turning it on surfaced 1310 issues against a maxIssues: 0 gate. Worked down as follows:

count action
ktlint formatting ~700 auto-corrected (separate commit)
config bugs, not defects ~450 fixed the rules
genuine debt 258 baselined

detekt.yml was also invalid for 1.23.8 (renamed ComplexMethod, deprecated ForbiddenComment.values/customMessage, excludedFunctions as a comma-string) — fatal under warningsAsErrors: true.

Two rules were misconfigured rather than strict:

  • FunctionNaming flagged 100 @Composable functions — the config used excludeClassPattern, which doesn't do that; ignoreAnnotated does.
  • MagicNumber fired on ColorSchemes (HCT tone tables) and ImageOps (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:286 read Locale.getDefault() inside a composable (NonObservableLocale), so history timestamps would not re-format when the user changed system locale. Now uses LocalLocale.current.platformLocale, with the SimpleDateFormat hoisted into a remember.

Verified locally

  • ./gradlew lintBUILD SUCCESSFUL (was: 1 error)
  • ./gradlew compileDebugKotlinBUILD SUCCESSFUL (confirms the 87-file format pass is safe)
  • detekt → exit 0 baselined, exit 2 on new issues

Reviewing

Read it commit-by-commit — the two real fixes are isolated from the formatting churn, which is style: apply detekt --auto-correct and 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

Azyrn and others added 3 commits July 13, 2026 06:21
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>
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scanly Ready Ready Preview, Comment Jul 13, 2026 5:22am

@github-advanced-security

Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@Azyrn Azyrn merged commit 5388340 into main Jul 13, 2026
7 checks passed
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.

2 participants