As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Unverified Commit eda03af9 authored by Ash McKenzie's avatar Ash McKenzie
Browse files

Add lefthook support and make lint target

parent d67a26d9
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -19,6 +19,7 @@ cover.out
cover.xml
custom_hooks
hooks/*.d
/support/bin/golangci-*
/support/bin/gotestsum-*
tags
tmp/*
Loading
Loading
.PHONY: validate verify verify_ruby verify_golang test test_ruby test_golang test_fancy test_golang_fancy coverage coverage_golang setup _script_install build compile check clean install
.PHONY: validate verify verify_ruby verify_golang test test_ruby test_golang test_fancy test_golang_fancy coverage coverage_golang setup _script_install build compile check clean install lint
FIPS_MODE ?= 0
OS := $(shell uname | tr A-Z a-z)
Loading
Loading
@@ -10,6 +10,9 @@ BUILD_TAGS := tracer_static tracer_static_jaeger continuous_profiler_stackdriver
GOTESTSUM_VERSION := 1.10.0
GOTESTSUM_FILE := support/bin/gotestsum-${GOTESTSUM_VERSION}
GOLANGCI_LINT_VERSION := 1.54.2
GOLANGCI_LINT_FILE := support/bin/golangci-lint-${GOLANGCI_LINT_VERSION}
export GOFLAGS := -mod=readonly
ifeq (${FIPS_MODE}, 1)
Loading
Loading
@@ -75,6 +78,13 @@ coverage: coverage_golang
coverage_golang:
[ -f cover.out ] && go tool cover -func cover.out
lint: ${GOLANGCI_LINT_FILE}
${GOLANGCI_LINT_FILE} run --issues-exit-code 0 --print-issued-lines=false
${GOLANGCI_LINT_FILE}:
mkdir -p $(shell dirname ${GOLANGCI_LINT_FILE})
curl -L https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-${OS}-amd64.tar.gz | tar --strip-components 1 -zOxf - golangci-lint-${GOLANGCI_LINT_VERSION}-${OS}-amd64/golangci-lint > ${GOLANGCI_LINT_FILE} && chmod +x ${GOLANGCI_LINT_FILE}
setup: _script_install bin/gitlab-shell
_script_install:
Loading
Loading
pre-push:
commands:
test:
run: make test
# Disabled for now as there's _lots_ of linter errors
#lint:
# run: make lint
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment