Prevent code accidentally going into production

Have you solved this? I know 2 years have passed, but I just found this while searching what was STOPSHIP after finding it by accident while commenting.

StopShip
--------
Summary: Code contains STOPSHIP marker

Priority: 10 / 10
Severity: Warning
Category: Correctness
NOTE: This issue is disabled by default!
You can enable it by adding --enable StopShip

So I would say you should have executed the command in order to enable it.


I've been using this flag reliably for several years now:

BuildConfig.DEBUG

It doesn't have the issues that occurred long ago, when I posted this question.


Starting from Android Gradle Plugin 3.0 you can make following configuration in build.gradle file:


    android { 
        lintOptions {
            fatal 'StopShip' 
        } 
    }

This will break the build as long as there exists a StopShip comment in codebase.

Watch the exact minute of Tor Norbye's "Kotlin Static Analysis with Android Lint" talk, where he talks about the feature.