DarioMartin / Wanago

A group app project for the Architect Coders course.
0 stars 2 forks source link

Add Detekt plugin to Gradle #4

Open DarioMartin opened 1 year ago

DarioMartin commented 1 year ago

https://detekt.dev/docs/intro

nachogoro commented 1 year ago

PR is here: https://github.com/DarioMartin/Wanago/pull/11

A possible issue here is that there is no proper integration between Android Studio and Detekt, so it is not possible to tell Android Studio to reformat code using the Detekt rules (Android Studio uses its own XML files inside .idea/codestyles). The only options are:

  1. Abandon Android Studio auto-formatting or Detekt.
  2. Manually keep both of them in sync. We could put the Android Studio .xml as part of the repo and keep it in sync manually with the current state of Detekt and any future changes.
  3. Create a script or a Detekt plugin which processes Android Studio's config and adapts to it, so we have a single source of truth.

Option 1 and 2 are not great, and option 3 seems like a big time sink, so I think we might need to live with this for now :)