def codacy_result(hit, path):
    """Convert a hit to the Codacy result format

    :param hit : a cfn-lint hit in json format
    :param path: the path of the file where the hit occured
    :return    : dictionary conforming to the Codacy format
    """
    return dict(filename=path,
              message=hit["Message"],
              patternId=hit["Rule"]["Id"],
              line=hit["Location"]["Start"]["LineNumber"])