<commit_before># The file name of the binary to output
BINARY_FILENAME := docker-credential-gcr
# The output directory
OUT_DIR := bin
# The directory to dump generated mocks
MOCK_DIR := mock
# The non-vendor golang sources to validate.
SRCS := $(shell find **/*.go -type f | grep -v vendor/)

all: clean bin

deps:
	@go get -u -t ./...
	
testdeps:
	@go get -u -t ./...
	@go get -u github.com/golang/mock/gomock
	@go get -u github.com/golang/mock/mockgen

bin: deps
	@go build -i -o ${OUT_DIR}/${BINARY_FILENAME} main.go
	@echo Binary created: ${OUT_DIR}/${BINARY_FILENAME}

clean:
	@rm -rf ${OUT_DIR}
	@rm -rf ${MOCK_DIR}
	@go clean

mocks:
	@rm -rf ${MOCK_DIR}
	@mkdir -p ${MOCK_DIR}/mock_store
	@mkdir -p ${MOCK_DIR}/mock_config
	@mkdir -p ${MOCK_DIR}/mock_cmd
	@mockgen -destination=${MOCK_DIR}/mock_store/mocks.go github.com/GoogleCloudPlatform/docker-credential-gcr/store GCRCredStore
	@mockgen -destination=${MOCK_DIR}/mock_config/mocks.go github.com/GoogleCloudPlatform/docker-credential-gcr/config UserConfig
	@mockgen -destination=${MOCK_DIR}/mock_cmd/mocks.go github.com/GoogleCloudPlatform/docker-credential-gcr/util/cmd Command

test: clean testdeps mocks bin
	@go test -timeout 10s -v -tags="unit integration surface" ./...

unit-tests: testdeps mocks
	@go test -timeout 10s -v -tags=unit ./...
	
integration-tests: testdeps
	@go test -timeout 10s -v -tags=integration ./...
	
surface-tests: deps testdeps bin
	@go test -timeout 10s -v -tags=surface ./...
	
vet: 
	@go vet ./...

lint:
	@echo 'Running golint...'
	@$(foreach src,$(SRCS),golint $(src);)
	
criticism: clean vet lint

fmt:<commit_msg>fix vendored mock dependency<commit_after># The file name of the binary to output
BINARY_FILENAME := docker-credential-gcr
# The output directory
OUT_DIR := bin
# The directory to dump generated mocks
MOCK_DIR := mock
# The non-vendor golang sources to validate.
SRCS = $(shell find . -name "*.go" -type f | grep -v vendor/)

all: clean bin

deps:
	@go get -u -t ./...
	
testdeps:
	@go get -u -t ./...
	@go get -u github.com/golang/mock/gomock
	@go get -u github.com/golang/mock/mockgen

bin: deps
	@go build -i -o ${OUT_DIR}/${BINARY_FILENAME} main.go
	@echo Binary created: ${OUT_DIR}/${BINARY_FILENAME}

clean:
	@rm -rf ${OUT_DIR}
	@rm -rf ${MOCK_DIR}
	@go clean

mocks:
	@rm -rf ${MOCK_DIR}
	@mkdir -p ${MOCK_DIR}/mock_store
	@mkdir -p ${MOCK_DIR}/mock_config
	@mkdir -p ${MOCK_DIR}/mock_cmd
	@mockgen -destination ${MOCK_DIR}/mock_store/mocks.go github.com/GoogleCloudPlatform/docker-credential-gcr/store GCRCredStore
	@mockgen -destination ${MOCK_DIR}/mock_config/mocks.go github.com/GoogleCloudPlatform/docker-credential-gcr/config UserConfig
	@mockgen -destination ${MOCK_DIR}/mock_cmd/mocks.go github.com/GoogleCloudPlatform/docker-credential-gcr/util/cmd Command
	
strip-vendor-dependencies:
	@sed -i 's/github.com\/GoogleCloudPlatform\/docker-credential-gcr\/vendor\///g' ${SRCS}

test: clean testdeps mocks strip-vendor-dependencies bin
	@go test -timeout 10s -v -tags="unit integration surface" ./...

unit-tests: testdeps mocks
	@go test -timeout 10s -v -tags=unit ./...
	
integration-tests: testdeps
	@go test -timeout 10s -v -tags=integration ./...
	
surface-tests: deps testdeps bin
	@go test -timeout 10s -v -tags=surface ./...
	
vet: 
	@go vet ./...

lint:
	@echo 'Running golint...'
	@$(foreach src,$(SRCS),golint $(src);)
	
criticism: clean vet lint

fmt:
{'fraction_non_alphanumeric': 0.1502804842043106, 'fraction_numerical': 0.0047239444936522, 'mean_word_length': 3.7318435754189943, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6548747', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1250, 'n_words': 334}