From 73c542c93451b6ee12626a3a883d5bd2d12f386e Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Sat, 28 Mar 2020 10:39:17 +0100 Subject: [PATCH] travis+lint+make: limit lint concurrency only on travis Since linting is much faster by using the defaults locally. --- .golangci.yml | 4 ---- .travis.yml | 2 +- Makefile | 8 +++++++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index b3289f16..e05628a8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,10 +2,6 @@ run: # timeout for analysis deadline: 4m - # Linting uses a lot of memory. Keep it under control by only running a single - # worker. - concurrency: 1 - # Skip autogenerated files for mobile. skip-files: - "mobile\\/.*generated\\.go" diff --git a/.travis.yml b/.travis.yml index 32a9f5b5..138d0b2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ jobs: script: - make rpc-check - make unit pkg=... case=_NONE_ - - make lint + - make lint workers=1 - make btcd - LNDBUILDSYS=windows-amd64 bash ./build/release/release.sh - stage: Test diff --git a/Makefile b/Makefile index d0495793..5ecd4929 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,13 @@ include make/testing_flags.mk DEV_TAGS := $(if ${tags},$(DEV_TAGS) ${tags},$(DEV_TAGS)) -LINT = $(LINT_BIN) run -v +# Linting uses a lot of memory, so keep it under control by limiting the number +# of workers if requested. +ifneq ($(workers),) +LINT_WORKERS = --concurrency=$(workers) +endif + +LINT = $(LINT_BIN) run -v $(LINT_WORKERS) GREEN := "\\033[0;32m" NC := "\\033[0m"