tasks/go.py
def golangci_lint(ctx, targets, rtloader_root=None, build_tags=None, arch="x64"):
    """
    Run golangci-lint on targets using .golangci.yml configuration.

    Example invocation:
        inv golangci-lint --targets=./pkg/collector/check,./pkg/aggregator
    """
    if isinstance(targets, str):
        # when this function is called from the command line, targets are passed
        # as comma separated tokens in a string
        targets = targets.split(',')

    tags = build_tags or get_default_build_tags(build="test", arch=arch)
    _, _, env = get_build_flags(ctx, rtloader_root=rtloader_root)
    # we split targets to avoid going over the memory limit from circleCI
    for target in targets:
        print(f"running golangci on {target}")
        ctx.run(
            f"golangci-lint run --timeout 10m0s --build-tags '{' '.join(tags)}' {target}/...",
            env=env,
        )

    # golangci exits with status 1 when it finds an issue, if we're here
    # everything went smooth
    print("golangci-lint found no issues")

    Run golangci-lint on targets using .golangci.yml configuration.

    Example invocation:
        inv golangci-lint --targets=./pkg/collector/check,./pkg/aggregator
    
Run golangci-lint on targets using .golangci.yml configuration.
Run golangci - lint on targets using . golangci . yml configuration .
def golangci_lint(ctx, targets, rtloader_root=None, build_tags=None, arch="x64"):
    if isinstance(targets, str):
        targets = targets.split(',')
    tags = build_tags or get_default_build_tags(build="test", arch=arch)
    _, _, env = get_build_flags(ctx, rtloader_root=rtloader_root)
    for target in targets:
        print(f"running golangci on {target}")
        ctx.run(
            f"golangci-lint run --timeout 10m0s --build-tags '{' '.join(tags)}' {target}/...",
            env=env,
        )
    print("golangci-lint found no issues")
def golangci_lint ( ctx , targets , rtloader_root = None , build_tags = None , arch = "x64" ) : if isinstance ( targets , str ) : targets = targets . split ( ',' ) tags = build_tags or get_default_build_tags ( build = "test" , arch = arch ) _ , _ , env = get_build_flags ( ctx , rtloader_root = rtloader_root ) for target in targets : print ( f"running golangci on {target}" ) ctx . run ( f"golangci-lint run --timeout 10m0s --build-tags '{' '.join(tags)}' {target}/..." , env = env , ) print ( "golangci-lint found no issues" )
Run golangci-lint on targets using .golangci.yml configuration.
Run golangci - lint on targets using . golangci . yml configuration .
"""
    Run golangci-lint on targets using .golangci.yml configuration.

    Example invocation:
        inv golangci-lint --targets=./pkg/collector/check,./pkg/aggregator
    """ # when this function is called from the command line, targets are passed # as comma separated tokens in a string # we split targets to avoid going over the memory limit from circleCI # golangci exits with status 1 when it finds an issue, if we're here # everything went smooth
ctx
targets
rtloader_root
build_tags
arch