From e88df388a145a22ea41d9572df7875ebe5c5c357 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst Date: Thu, 26 Dec 2019 16:38:26 +0000 Subject: [PATCH] Add gofumports step to CI --- .circleci/config.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a40cec1..639916f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,23 @@ jobs: steps: - checkout - run: go build ./... + format: + docker: + - image: golang:latest + steps: + - checkout + - run: + name: Install gofumports outside local module + command: | + cd $(mktemp -d) && + go mod init tmp && + go get mvdan.cc/gofumpt/gofumports@latest + - run: + name: Run gofumports on all non-generated files + command: grep -L -R "^\/\/ Code generated .* DO NOT EDIT\.$" --exclude-dir=.git --exclude-dir=vendor --include="*.go" | xargs -n 1 gofumports -w -local github.com/johanbrandhorst/certify + - run: + name: Check for any changes + command: git diff --exit-code vendor: docker: - image: golang:latest @@ -59,6 +76,7 @@ workflows: all: jobs: - build + - format - vendor - generate - test