Browse Source

Merge pull request #441 from ADustyOldMuffin/add-linting-to-reviewable

Add linting to reviewable
Lucas Severo Alves 4 years ago
parent
commit
1dd8ee3b25
2 changed files with 7 additions and 2 deletions
  1. 5 1
      .github/workflows/ci.yml
  2. 2 1
      Makefile

+ 5 - 1
.github/workflows/ci.yml

@@ -120,8 +120,12 @@ jobs:
           key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
           key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
           restore-keys: ${{ runner.os }}-pkg-
           restore-keys: ${{ runner.os }}-pkg-
 
 
+      # Check DIff also runs Reviewable which needs golangci-lint installed
       - name: Check Diff
       - name: Check Diff
-        run: make check-diff
+        run: |
+          wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.33.0
+          export PATH=$PATH:./bin
+          make check-diff
 
 
   unit-tests:
   unit-tests:
     runs-on: ubuntu-18.04
     runs-on: ubuntu-18.04

+ 2 - 1
Makefile

@@ -66,7 +66,7 @@ FAIL	= (echo ${TIME} ${RED}[FAIL]${CNone} && false)
 # Conformance
 # Conformance
 
 
 # Ensure a PR is ready for review.
 # Ensure a PR is ready for review.
-reviewable: generate helm.generate
+reviewable: generate helm.generate lint
 	@go mod tidy
 	@go mod tidy
 
 
 # Ensure branch is clean.
 # Ensure branch is clean.
@@ -119,6 +119,7 @@ lint: lint.check ## run golangci-lint
 		echo -e "\033[0;33mgolangci-lint failed: some checks can be fixed with \`\033[0;32mmake fmt\033[0m\033[0;33m\`\033[0m"; \
 		echo -e "\033[0;33mgolangci-lint failed: some checks can be fixed with \`\033[0;32mmake fmt\033[0m\033[0;33m\`\033[0m"; \
 		exit 1; \
 		exit 1; \
 	fi
 	fi
+	@$(OK) Finished linting
 
 
 fmt: lint.check ## ensure consistent code style
 fmt: lint.check ## ensure consistent code style
 	@go mod tidy
 	@go mod tidy