github.com/hyperledger/aries-framework-go@v0.3.2/scripts/check_lint.sh (about)

     1  #!/bin/bash
     2  #
     3  # Copyright SecureKey Technologies Inc. All Rights Reserved.
     4  #
     5  # SPDX-License-Identifier: Apache-2.0
     6  #
     7  
     8  set -e
     9  
    10  echo "Running $0"
    11  
    12  DOCKER_CMD=${DOCKER_CMD:-docker}
    13  GOLANGCI_LINT_IMAGE="golangci/golangci-lint:v1.50.1"
    14  
    15  if [ ! $(command -v ${DOCKER_CMD}) ]; then
    16      exit 0
    17  fi
    18  
    19  echo "linting root directory.."
    20  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace ${GOLANGCI_LINT_IMAGE} golangci-lint run
    21  echo "done linting root directory"
    22  echo "linting with js/wasm.."
    23  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY}  -e GOOS=js -e GOARCH=wasm -v $(pwd):/opt/workspace -w /opt/workspace ${GOLANGCI_LINT_IMAGE} golangci-lint run
    24  echo "done linting with js/wasm"
    25  echo "linting cmd/aries-agent-rest.."
    26  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/cmd/aries-agent-rest ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../../.golangci.yml
    27  echo "done linting cmd/aries-agent-rest"
    28  echo "linting cmd/aries-agent-mobile.."
    29  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/cmd/aries-agent-mobile ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../../.golangci.yml
    30  echo "done linting cmd/aries-agent-mobile"
    31  echo "linting test/bdd.."
    32  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/test/bdd ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../../.golangci.yml
    33  echo "done linting test/bdd"
    34  echo "linting spi.."
    35  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/spi ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../.golangci.yml
    36  echo "done linting spi"
    37  echo "linting component/log.."
    38  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/component/log ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../../.golangci.yml
    39  echo "done linting component/log"
    40  echo "linting component/storageutil.."
    41  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/component/storageutil ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../../.golangci.yml
    42  echo "done linting component/storageutil"
    43  echo "linting component/kmscrypto.."
    44  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/component/kmscrypto ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../../.golangci.yml
    45  echo "done linting component/kmscrypto"
    46  echo "linting component/models.."
    47  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/component/models ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../../.golangci.yml
    48  echo "done linting component/models"
    49  echo "linting component/storage/edv.."
    50  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/component/storage/edv ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../../../.golangci.yml
    51  echo "done linting component/storage/edv"
    52  echo "linting component/storage/leveldb.."
    53  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/component/storage/leveldb ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../../../.golangci.yml
    54  echo "done linting component/storage/leveldb"
    55  echo "linting component/storage/indexeddb.."
    56  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -e GOOS=js -e GOARCH=wasm -v $(pwd):/opt/workspace -w /opt/workspace/component/storage/indexeddb ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../../../.golangci.yml
    57  echo "done linting component/storage/indexeddb"
    58  echo "linting component/storage.."
    59  ${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/test/component/storage/ ${GOLANGCI_LINT_IMAGE} golangci-lint run -c ../../../.golangci.yml
    60  echo "done linting component/storage"
    61  
    62  echo "Done Running $0"