(check_name, file, verbose)
Warns when the integration check function contains the `instance` parameter.
Warns when the integration check function contains the `instance` parameter.
Warns when the integration check function contains the instance parameter .
def validate_check_instance(check_name, file, verbose):
    """
    Warns when the integration check function contains the `instance` parameter.
    """
    with open(file, 'r', encoding='utf-8') as f:
        read_file = f.read()
        found_match_arg = re.search(r"def check\(self, instance\):", read_file)
        if found_match_arg and verbose:
            message = (
                "The instance argument in the `check()` function is going to be "
                "deprecated in Agent 8. Please use `self.instance` instead."
            )
            echo_warning(f"{check_name}: " + message)
            annotate_warning(file, message)
def validate_check_instance ( check_name , file , verbose ) : with open ( file , 'r' , encoding = 'utf-8' ) as f : read_file = f . read ( ) found_match_arg = re . search ( r"def check\(self, instance\):" , read_file ) if found_match_arg and verbose : message = ( "The instance argument in the `check()` function is going to be " "deprecated in Agent 8. Please use `self.instance` instead." ) echo_warning ( f"{check_name}: " + message ) annotate_warning ( file , message )