Skip to content

Fix lint errors surfaced by the new nightly lint job#1937

Merged
bmander merged 1 commit into
mainfrom
fix/nightly-lint-failures
Jul 17, 2026
Merged

Fix lint errors surfaced by the new nightly lint job#1937
bmander merged 1 commit into
mainfrom
fix/nightly-lint-failures

Conversation

@bmander

@bmander bmander commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

The nightly lint job (added in #1914) is the first run of lintObaGoogleDebug since lint was pulled off the PR/push path in #1843, so two unrelated regressions that accumulated in that gap surfaced together and broke today's nightly run:

  • AdjacencyRouteColors.kt (2 RestrictedApi errors): the file's @SuppressLint("RestrictedApi") covers adjacencyRouteColors(), but the actual restricted Hct.from(...).toInt() calls live in the private routeColor() it calls — suppressions don't propagate across function boundaries. Added the same annotation directly to routeColor(), matching the existing rationale/pattern used there and in LineBadge.kt.
  • ArrivalRows.kt / ArrivalsScreen.kt (2 ModifierParameter errors): Add adjacency-aware stop and route focus to the map #1865 added new optional parameters ahead of the existing modifier: Modifier = Modifier parameter in RouteArrivalRow and ArrivalsList, violating the Compose convention that modifier be the first optional parameter. Moved modifier back into position in both. All call sites use named arguments, so this is a safe reorder.

Test plan

  • ./gradlew :onebusaway-android:compileObaGoogleDebugKotlin -PwarningsAsErrors=true — clean
  • ./gradlew :onebusaway-android:lintObaGoogleDebug -PwarningsAsErrors=true — clean (was failing with 4 errors before this fix)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved internal lint handling without changing route color behavior.
    • Updated arrivals list and route row configuration for more consistent UI composition.
  • Refactor
    • Reordered arrivals component parameters to support clearer and more reliable customization.

The lint job added in #1914 is the first run of lintObaGoogleDebug since
lint was pulled off PR/push CI in #1843, so two unrelated regressions from
that gap surfaced together:

- AdjacencyRouteColors.kt's @SuppressLint("RestrictedApi") covers
  adjacencyRouteColors() but not the private routeColor() it calls, where
  the actual restricted Hct.from(...).toInt() calls live.
- #1865 added new optional parameters ahead of the existing `modifier`
  parameter in RouteArrivalRow and ArrivalsList, breaking the Compose
  convention that modifier be the first optional parameter.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8c506883-b669-40f5-9893-d1877a1ae53b

📥 Commits

Reviewing files that changed from the base of the PR and between 7fa89d8 and 05d013c.

📒 Files selected for processing (3)
  • onebusaway-android/src/main/java/org/onebusaway/android/map/AdjacencyRouteColors.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/arrivals/ArrivalsScreen.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/arrivals/components/ArrivalRows.kt

📝 Walkthrough

Walkthrough

The changes reorder parameters in two arrivals composables and add a targeted lint suppression with explanatory context for the route color function. Runtime implementations and color-derivation logic remain unchanged.

Changes

Arrivals API and lint adjustments

Layer / File(s) Summary
Arrivals composable signature ordering
onebusaway-android/src/main/java/org/onebusaway/android/ui/arrivals/ArrivalsScreen.kt, onebusaway-android/src/main/java/org/onebusaway/android/ui/arrivals/components/ArrivalRows.kt
ArrivalsList and RouteArrivalRow parameter ordering is updated while defaults and implementations remain unchanged.
Route color lint suppression
onebusaway-android/src/main/java/org/onebusaway/android/map/AdjacencyRouteColors.kt
Adds explanatory context and applies @SuppressLint("RestrictedApi") directly to routeColor.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the PR’s main goal: fixing lint errors caught by the nightly lint job.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nightly-lint-failures

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bmander
bmander merged commit 99a133d into main Jul 17, 2026
3 checks passed
@bmander
bmander deleted the fix/nightly-lint-failures branch July 17, 2026 18:09
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.

1 participant