tasks/go.py
def lint_licenses(ctx):
    """
    Checks that the LICENSE-3rdparty.csv file is up-to-date with contents of go.sum
    """
    print("Verify licenses")

    licenses = []
    file = 'LICENSE-3rdparty.csv'
    with open(file, 'r', encoding='utf-8') as f:
        next(f)
        for line in f:
            licenses.append(line.rstrip())

    new_licenses = get_licenses_list(ctx)

    removed_licenses = [ele for ele in new_licenses if ele not in licenses]
    for license in removed_licenses:
        print(f"+ {license}")

    added_licenses = [ele for ele in licenses if ele not in new_licenses]
    for license in added_licenses:
        print(f"- {license}")

    if len(removed_licenses) + len(added_licenses) > 0:
        raise Exit(
            message=textwrap.dedent(
                """\
                Licenses are not up-to-date.

                Please run 'inv generate-licenses' to update {}."""
            ).format(file),
            code=1,
        )

    print("Licenses are ok.")

    Checks that the LICENSE-3rdparty.csv file is up-to-date with contents of go.sum
    
Checks that the LICENSE-3rdparty.csv file is up-to-date with contents of go.sum
Checks that the LICENSE - 3rdparty . csv file is up - to - date with contents of go . sum
def lint_licenses(ctx):
    print("Verify licenses")
    licenses = []
    file = 'LICENSE-3rdparty.csv'
    with open(file, 'r', encoding='utf-8') as f:
        next(f)
        for line in f:
            licenses.append(line.rstrip())
    new_licenses = get_licenses_list(ctx)
    removed_licenses = [ele for ele in new_licenses if ele not in licenses]
    for license in removed_licenses:
        print(f"+ {license}")
    added_licenses = [ele for ele in licenses if ele not in new_licenses]
    for license in added_licenses:
        print(f"- {license}")
    if len(removed_licenses) + len(added_licenses) > 0:
        raise Exit(
            message=textwrap.dedent(
                """\
                Licenses are not up-to-date.
                Please run 'inv generate-licenses' to update {}."""
            ).format(file),
            code=1,
        )
    print("Licenses are ok.")
def lint_licenses ( ctx ) : print ( "Verify licenses" ) licenses = [ ] file = 'LICENSE-3rdparty.csv' with open ( file , 'r' , encoding = 'utf-8' ) as f : next ( f ) for line in f : licenses . append ( line . rstrip ( ) ) new_licenses = get_licenses_list ( ctx ) removed_licenses = [ ele for ele in new_licenses if ele not in licenses ] for license in removed_licenses : print ( f"+ {license}" ) added_licenses = [ ele for ele in licenses if ele not in new_licenses ] for license in added_licenses : print ( f"- {license}" ) if len ( removed_licenses ) + len ( added_licenses ) > 0 : raise Exit ( message = textwrap . dedent ( """\
                Licenses are not up-to-date.

                Please run 'inv generate-licenses' to update {}.""" ) . format ( file ) , code = 1 , ) print ( "Licenses are ok." )
Checks that the LICENSE-3rdparty.csv file is up-to-date with contents of go.sum
Checks that the LICENSE - 3rdparty . csv file is up - to - date with contents of go . sum
"""
    Checks that the LICENSE-3rdparty.csv file is up-to-date with contents of go.sum
    """
ctx