diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 4527e8633c..57bf751eb1 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -100,10 +100,8 @@ pipeline { unstash 'source' withGoEnv(version: "${GO_VERSION}"){ dir(BASE_DIR){ - catchError(message: 'There were some failures when running pre-commit checks', buildResult: 'SUCCESS') { - sh script: '.ci/scripts/install-dependencies.sh', label: 'Install dependencies' - preCommit(commit: "${GIT_BASE_COMMIT}", junit: true) - } + sh script: '.ci/scripts/install-dependencies.sh', label: 'Install dependencies' + preCommit(commit: "${GIT_BASE_COMMIT}", junit: true) } } } diff --git a/.ci/scripts/golangci-lint.sh b/.ci/scripts/golangci-lint.sh deleted file mode 100755 index 79d04fba36..0000000000 --- a/.ci/scripts/golangci-lint.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -## Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -## or more contributor license agreements. Licensed under the Elastic License; -## you may not use this file except in compliance with the Elastic License. - -BASEDIR=$(dirname "$0") - -error=0 - -function run() { - local module=${1} - local file=${2} - - cd ${module} - if [[ $(echo $file |grep "^${module}") ]]; then - parsedFile=$(echo $file |sed "s#${module}/##") - golangci-lint run "${parsedFile}" || error=1 - fi - cd - -} - -for file in "$@"; do - echo "golangci-lint run ${file}" - run "cli" "${file}" - run "e2e" "${file}" -done - -if [[ ${error} -gt 0 ]]; then - echo "Lint failed!" - exit ${error} -fi diff --git a/.ci/scripts/install-dependencies.sh b/.ci/scripts/install-dependencies.sh index e023ba0590..b953966dda 100755 --- a/.ci/scripts/install-dependencies.sh +++ b/.ci/scripts/install-dependencies.sh @@ -11,7 +11,6 @@ set -euxo pipefail # Install some other dependencies required for the pre-commit go get -v golang.org/x/lint/golint -go get -v github.com/golangci/golangci-lint/cmd/golangci-lint@v1.18.0 go get -v github.com/go-lintpack/lintpack/... go get -v github.com/go-critic/go-critic/... lintpack build -o bin/gocritic -linter.version='v0.3.4' -linter.name='gocritic' github.com/go-critic/go-critic/checkers diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bf9328fbfc..e3ecc86b49 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,13 +37,3 @@ repos: - id: check-jjbb - id: check-gherkin-lint args: ["--disable", "AvoidOutlineForSingleExample,TooClumsy,TooLongStep,TooManyDifferentTags,TooManySteps"] - -- repo: local - hooks: - - id: golangci-lint - name: 'golangci-lint' - entry: .ci/scripts/golangci-lint.sh - language: 'script' - verbose: true - files: '\.go$' - description: "Runs `golangci-lint`, requires https://github.com/golangci/golangci-lint"