hooks
hooks copied to clipboard
Custom methods must be protected
- Any method declared as public, must be provided from ConanFile
- Any custom method must be declared as protected
- Any private method is not be accepted
closes #126
Wiki:
#KB-H036: "CUSTOM METHODS"
When a new method have to be added to the recipe, and it is not a default one provided by ConanFile, it must added as protected:
class Recipe(ConanFile):
def configure(self): # default methods are public
pass
def _configure_cmake(self): # custom methods are protected
pass
def __private_routine(self): # private should not be used. Use protected instead.
pass
@uilianries also, I wonder, why do we forbid to use private members? is it somehow bad/harmful?
@SSE4 private attributes are not bad, but how many times we needed them for a recipe? Maybe twice all this time, only for workarounds and helpers, which are not the regular flow.