Skip to content

Enable UnusedImport rule in detekt config - #838

Merged
mmathieum merged 1 commit into
masterfrom
mm/detekt_unusedimports
Aug 9, 2026
Merged

mmathieum merged 1 commit into
masterfrom
mm/detekt_unusedimports

Conversation

@mmathieum

Copy link
Copy Markdown
Member

No description provided.

@mmathieum mmathieum self-assigned this Aug 9, 2026
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Enable Detekt UnusedImport rule

⚙️ Configuration changes 🕐 Less than 5 minutes

Grey Divider

AI Description

• Enable Detekt's UnusedImport rule to flag unused Kotlin imports.
• Configure the rule with an explicit empty additionalOperatorSet for determinism.
Diagram

graph TD
  A["detekt-config.yml"] --> B(["Detekt UnusedImport"])
  C(["CI lint step"]) --> B --> D["Kotlin sources"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Introduce a Detekt baseline (or gradual rollout)
  • ➕ Allows enabling UnusedImport without immediately failing CI on existing violations
  • ➕ Supports incremental cleanup over time
  • ➖ Adds baseline maintenance overhead
  • ➖ Can hide newly introduced issues if not configured carefully

Recommendation: Current approach is appropriate if the codebase is already clean (or expected to be) with respect to unused imports. If this introduces widespread CI failures, consider adding a Detekt baseline or rolling out the rule module-by-module to keep the signal high while paying down existing violations.

Files changed (1) +3 / -0

Other (1) +3 / -0
detekt-config.ymlEnable UnusedImport rule in Detekt config +3/-0

Enable UnusedImport rule in Detekt config

• Turns on the 'UnusedImport' rule under 'style'. Also sets 'additionalOperatorSet' explicitly to an empty list.

config/detekt/detekt-config.yml

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 51edc0d1-60cf-4ce4-933c-732b734fc5ef

📥 Commits

Reviewing files that changed from the base of the PR and between 670cc58 and a4c2c6e.

📒 Files selected for processing (1)
  • config/detekt/detekt-config.yml

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Enabled detection of unused imports during code quality checks.
    • Updated static analysis configuration for operator handling.

Walkthrough

The Detekt configuration enables the active UnusedImport rule and sets the additional operator set to empty.

Changes

Detekt configuration

Layer / File(s) Summary
Enable unused import checks
config/detekt/detekt-config.yml
Enables UnusedImport and configures no additional operators.

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

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided, so the change has no author-provided explanation. Add a brief description that explains the Detekt configuration change and its purpose.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: enabling the UnusedImport rule in the Detekt configuration.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mm/detekt_unusedimports

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.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can ask Qodo to dismiss a finding you disagree with, with your reason on record

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@mmathieum
mmathieum merged commit 2d95c33 into master Aug 9, 2026
4 checks passed
@mmathieum
mmathieum deleted the mm/detekt_unusedimports branch August 9, 2026 20:31
montransit added a commit to mtransitapps/mtransit-for-android that referenced this pull request Aug 9, 2026
montransit added a commit to mtransitapps/ca-st-hyacinthe-transport-collectif-bus-android that referenced this pull request Aug 10, 2026
montransit added a commit to mtransitapps/ca-mrc-nicolet-yamaska-bili-bus-android that referenced this pull request Aug 10, 2026
montransit added a commit to mtransitapps/ca-vancouver-mobi-bike-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-quebec-a-velo-bike-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-merritt-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-pierre-de-saurel-stc-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-south-okanagan-similkameen-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-prince-george-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-west-kootenay-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-west-coast-express-train-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-vancouver-translink-train-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-whistler-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-mississauga-miway-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-laval-stl-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/us-everett-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-kelowna-regional-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/fr-haute-garonne-lio-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/us-snohomish-county-community-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-vancouver-translink-ferry-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-west-coast-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-grand-river-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/fr-hautes-pyrenees-lio-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-gatineau-sto-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-quebec-traversiers-ferry-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-williams-lake-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-mrc-haut-st-laurent-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-mrc-montcalm-transport-collectif-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-yellowknife-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-revelstoke-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-annapolis-valley-tidal-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-nanaimo-rdn-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-moose-jaw-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-powell-river-regional-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-st-jean-sur-richelieu-transport-collectif-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-barrie-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-campbell-river-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-montreal-stm-subway-android that referenced this pull request Aug 11, 2026
…parser':

- commons: Enable `UnusedImport` rule in `detekt` config mtransitapps/commons#838
- commons: `download()` > remove `Accept: application/zip` for ZIP files (revert #834)
- commons: Add `detekt` mtransitapps/commons#836
- commons: `mt-download.yml` > omit `--ref` on default branch to avoid `mt-sync-code-data.yml` starting with the wrong hash mtransitapps/commons#835
- commons: `download()` > `Accept: application/zip` for ZIP files mtransitapps/commons#834
- commons: Add initial .pr_agent.toml configuration file
- commons: Add Qodo config to `.pr_agent.toml` mtransitapps/commons#833
- commons: Google--
- commons: `libs.versions.toml` > add links to changelogs in comments
- commons: Update Liftoff/Vungle from 7.7.4.2 to 7.7.6.0. mtransitapps/commons#832
- commons: Upgrade maps-utils `4.5.2` -> `5.0.0` mtransitapps/commons#831
- commons: Initialize .coderabbit.yaml with review settings mtransitapps/commons#830
- commons: Add `.coderabbit.yaml` configuration mtransitapps/commons#829
- commons: Update maps dependencies mtransitapps/commons#826
- commons: Update Kotlin from `2.3.21` to `2.4.10` mtransitapps/commons#827
- commons: Update Hilt from `2.59.2` to `2.60.1` mtransitapps/commons#828
- commons: Update Protobuf from `4.34.1` to `4.35.1` mtransitapps/commons#825
- commons: Update OkHttp from `5.3.2` to `5.4.0` mtransitapps/commons#824
- commons: Update Glide version from `5.0.7` to `5.0.9` mtransitapps/commons#823
- commons: Bump org.xerial:sqlite-jdbc from 3.53.0.0 to 3.53.2.0 mtransitapps/commons#822
- commons: Build(deps): Bump android-gradlePlugin from 9.3.0 to 9.3.1 mtransitapps/commons#821
- commons: Use `git update-index --skip-worktree` to hide locally changed "key" files mtransitapps/commons#820
- commons: Build(deps): Bump com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk from 1.2.1 to 1.3.0 mtransitapps/commons#819
- commons: Target SDK `36` (Android 16) before Aug 31, 2026 mtransitapps/commons#817
- commons: Create `.aiexclude` to manage AI file exclusions mtransitapps/commons#816
- commons: Allow `download()` user-agent override via `MT_DOWNLOAD_USER_AGENT` mtransitapps/commons#815
- commons: Build(deps): Bump android-gradlePlugin from 9.2.1 to 9.3.0 mtransitapps/commons#814
- commons: Fix `mt-record-screenshots.yml` #810
- commons: Switch latest APK fetch to `gh release download` and pick first APK artifact mtransitapps/commons#810
- commons: Build(deps): Bump com.google.ads.mediation:facebook from 6.21.0.3 to 6.21.0.4 in the ads group across 1 directory mtransitapps/commons#813
- commons: Build(deps): Bump com.google.firebase:firebase-bom from 34.15.0 to 34.16.0 in the gms group across 1 directory mtransitapps/commons#812
- commons: Build(deps): Bump com.google.devtools.ksp from 2.3.9 to 2.3.10 in the kotlin-ksp-compose group across 1 directory mtransitapps/commons#811
- commons: Gradle 9.4+ > enable parallel sync
- commons: Skip GitHub release creation when existing release is already latest mtransitapps/commons#809
- commons: runall.sh > print current directory on failure
- commons: Build(deps): Bump com.google.android.libraries.places:places from 5.2.0 to 5.3.0 mtransitapps/commons#808
- commons: Improve GTFS input logging with optional CSV-aware previews after archive preparation mtransitapps/commons#805
- commons: Try fixing download timeout issue #Brandon mtransitapps/commons#806
- commons: Add conditional retry for flaky GTFS download step in mt-download-data workflow mtransitapps/commons#807
- commons-android: GTFS-RT > Trip Updates > never ignore CANCELLED trips because too much into the future mtransitapps/commons-android#194
- commons-android: `Schedule` > + `hasRealTimeOrCancelled`
- commons-android: Add `detekt` mtransitapps/commons-android#193
- commons-android: GTFS-RT > ignore trip updates too much into the future... mtransitapps/commons-android#192
- commons-android: `Schedule.Timestamp` KT ext mtransitapps/commons-android#191
- commons-android: Add initial .pr_agent.toml configuration file
- commons-android: GTFS-RT > feeds `timestamp` max age mtransitapps/commons-android#189
- commons-android: Fix Weird Capitalization mtransitapps/commons-android#187
- commons-android: Google--
- commons-android: Fix assert from #185
- commons-android: GTFS-RT Trip Updates > filter duplicate unique trip updates #TripModifications mtransitapps/commons-android#185
- commons-android: GTFS-RT Trip Updates > fix static data used too small. mtransitapps/commons-android#184
- commons-android: Add configuration for auto review in coderabbit
- commons-android: Merge branch 'master' of github.com:mtransitapps/commons-android
- commons-android: suppress deprecated GTFS-RT vehicle location trip descriptor schedule relationship added
- commons-android: tests++
- commons-android: Ignore far away vehicles locations mtransitapps/commons-android#181
- commons-android: GTFS-RT Trip Update schedule status > fix wrong 1 min `validity` mtransitapps/commons-android#180
- commons-android: GTFS-RT > Trip Updates > try to fix wrong stop sequence when trip stop passed once & keep all cancelled trips/stops mtransitapps/commons-android#178
- commons-android: Update SSL cert mtransitapps/commons-android#177
- commons-android: GTFS-RT > Trip Updates > handle wrong stop sequence w/o loosing all data mtransitapps/commons-android#176
- commons-android: GTFS-RT Trip Update > fix same stop matching mtransitapps/commons-android#175
- commons-android: suppress
- commons-android: GTFS-RT > Trip filtering > allow ignore `direction_id` when `trip_id` is provided mtransitapps/commons-android#172
- commons-android: Status > `hasData` != `!noData` ('no data' means loaded w/o data) mtransitapps/commons-android#173
- commons-android: #isAndroidApp cleanup
- commons-android: cleanup
- commons-android: Filter `inFocus` cleanup & POI status `validity` (& `useful`) mtransitapps/commons-android#166
- commons-android: Delete `TimeExt.kt` mtransitapps/commons-android#169
- commons-android: Handle Twitter/X ISO-8601 millisecond timestamps in legacy date parsing mtransitapps/commons-android#167
- commons-android: Update GTFS Real-Time proto mtransitapps/commons-android#168
- commons-java: Add `detekt` mtransitapps/commons-java#46
- commons-java: Add initial .pr_agent.toml configuration file
- commons-java: fix `assert` -> `assertEquals`
- commons-java: Add initial configuration for coderabbit reviews
- commons-java: Source labels > ignore "gtfsapi" #TransLink
- commons-java: String utils > "and" -> "&" always (tests)
- commons-java: String utils > "and" -> "&" always
- commons-java: Add build-time `MT_DEBUG_DEFAULT` support for `Constants.DEBUG` mtransitapps/commons-java#45
- commons-java: Replace `(?U)` (no compat /w Android) with Unicode Property Classes like `\p{L}`.
- commons-java: CRASH fix created 5 hours ago in 478717d
- commons-java: regex scratch++
- commons-java: String cleaner > compat w/ `Les É/Î / Abc`
- commons-java: String cleaner > compat w/ `Les / Abc`
- commons-java: Regex scratch > + expected result
- commons-java: cleanup
- commons-java: Support for custom LC UC words min
montransit added a commit to mtransitapps/ca-banff-roam-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-mount-waddington-regional-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-victoria-regional-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-central-fraser-valley-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-kitimat-stikine-region-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-airdrie-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-sunshine-coast-regional-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-montreal-bixi-bike-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-creston-valley-regional-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-quebec-rtc-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-saskatoon-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-smithers-district-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-salt-spring-island-transit-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-squamish-transit-system-bus-android that referenced this pull request Aug 11, 2026
montransit added a commit to mtransitapps/ca-pemberton-valley-regional-transit-bus-android that referenced this pull request Aug 11, 2026
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