Ensures the given text is nowhere in the code base

You don't want any debug code to slip into production.
This can be used to check if there is any debug code still in your codebase or if you have things like // TO DO or similar.

Supported platforms ios, android, mac
Author @KrauseFx

5 Examples

ensure_no_debug_code(text: "// TODO")
ensure_no_debug_code(text: "Log.v",
      extension: "java")
ensure_no_debug_code(text: "NSLog",
 path: "./lib",
      extension: "m")
ensure_no_debug_code(text: "(^#define DEBUG|NSLog)",
 path: "./lib",
      extension: "m")
ensure_no_debug_code(text: "<<<<<<",
     extensions: ["m", "swift", "java"])


Key Description Default
text The text that must not be in the code base
path The directory containing all the source files .
extension The extension that should be searched for
extensions An array of file extensions that should be searched for
exclude Exclude a certain pattern from the search
exclude_dirs An array of dirs that should not be included in the search

* = default value is dependent on the user's system

To show the documentation in your terminal, run

fastlane action ensure_no_debug_code

View source code

Back to actions