# Per-rule overrides layered on top of detekt's defaults # (`--build-upon-default-config` on the CLI invocation in the Android lane). # # The pre-2.0 `build:` top-level was removed; failure is controlled by the CLI's # exit code instead. naming: # Composables conventionally use PascalCase function names. Matches every # mainstream Compose codebase, and mirrors the ktlint exemption in # android/.editorconfig — the two tools have to agree or one of them is always # wrong. FunctionNaming: ignoreAnnotated: - "Composable" style: MagicNumber: ignoreAnnotated: - "Composable" # Colour literals and dp constants are declared as named properties, which is # exactly the "define it as a well-named constant" the rule asks for — the # number simply appears in the declaration itself. Flagging # `private val Brand = Color(0xFFF5C518)` would demand a constant holding the # constant. ignorePropertyDeclaration: true exceptions: TooGenericExceptionCaught: # Catching broadly is DELIBERATE in these two places, and each site says so. # # * the ViewModel — a note that fails to save must become a visible error # banner, never a crash. Narrowing this would mean an unanticipated # failure takes the app down instead of being reported, which is strictly # worse for the user. # * the Application — the store failing to open is the one thing that must # still let the app start, so it can explain itself. # # Scoped to those paths rather than disabled globally: elsewhere the rule is # right and still applies. excludes: - "**/ui/**" - "**/ThoughtSyncApplication.kt"