CSenshi / Validator

Easy-to-use, Highly Configurable Python Data Validator. Inspired by Laravel Validator
https://pypi.org/project/validator/
MIT License
46 stars 23 forks source link

Change Rule Generation #44

Closed CSenshi closed 4 years ago

CSenshi commented 4 years ago

We generate new rule using make generate-rule F_NAME=new_rule

  1. It generates rule with following doc:

    """
    >>> TrueNewRule = NewRule()
    >>> TrueNewRule(...)
    True
    
    >>> FalseNewRule = NewRule()
    >>> FalseNewRule(...)
    False
    """

    We have redesigned README to work on rules with following docs:

    
    """
    Documentation...
    
    Examples:
    >>> NewRule().check(...)
    True
    
    >>> NewRule().check(...)
    False
    """

    Please change generated rule to look like one given above.

  2. Please change __call__ change to check

  3. Please change __init__ method to:

    def __init__(self):
            Rule.__init__(self)
CSenshi commented 4 years ago

Please work in the branch called change-rule-generation. There was one error in Makefile and changed it in there.

Note: changed make generate-rule F_NAME=new_rule to make rule F_NAME=new_rule