Removing prints, warnings and/or error functions
A rule that allows for the removal of calls the print(), warning() and error(). These could all be seperate rules or be all under a single rule, but I think having seperate rules for each would be best.
Maybe "remove_logging"? Where the rule has different options to remove print() and warn() (both enabled by default). Should probably have an option like preserve_arguments_side_effects in remove_debug_profiling.
Can't really see a reason to remove error() calls from the code but it could always be an option (though personally it should be off by default as it would change code behaviour).
Although if you want something to remove prints in a sort of production build you could always reimplement it with inject_global_value and remove_unused_if_branch:
if _G.PROD then
local NOOP = function() end
print = NOOP
warn = NOOP
end
-- These won't omit when the "PROD" value is true.
print("Hello World!")
warn("Warning message")
(If #36 gets added, the actual print() and warn() calls would also be entirely removed.)
Though this rule would remove the boilerplate code you would have to write in each file to add this right now.