Skip to content

Commit

Permalink
Use Go modules instead of Go dep
Browse files Browse the repository at this point in the history
  • Loading branch information
longsleep committed Nov 25, 2019
1 parent 1066ce0 commit d56d40d
Show file tree
Hide file tree
Showing 12 changed files with 459 additions and 593 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/.vscode
/cmd/konnectd/debug
/test/tests.*
/test/coverage.*
/golint.txt
/govet.txt
/dist
Expand Down
74 changes: 74 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
run:
modules-download-mode: vendor

linters-settings:
govet:
check-shadowing: true
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
golint:
min-confidence: 0
gocyclo:
min-complexity: 10
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
misspell:
locale: US
lll:
line-length: 140
goimports:
local-prefixes: stash.kopano.io/kc/kapi
gocritic:
enabled-tags:
- performance
- style
- experimental

linters:
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- bodyclose
- deadcode
- dupl
- errcheck
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- golint
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
- scopelint
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck

# don't enable:
# - depguard - until https://github.com/OpenPeeDeeP/depguard/issues/7 gets fixed
# - maligned,prealloc
# - gochecknoglobals
2 changes: 1 addition & 1 deletion .license-ranger.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"mode": "dep",
"mode": "mod",
"header": "# Kopano Konnect 3rd party licenses\n\nCopyright 2019 Kopano and its licensors. See LICENSE.txt for license information. This document contains a list of open source components used in this project.\n\n## Konnect konnectd\n"
}
59 changes: 59 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#
# Copyright 2019 Kopano and its licensors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3 or
# later, as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

FROM golang:1.13.4-buster

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ARG GOLANGCI_LINT_TAG=v1.21.0
RUN curl -sfL \
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b /usr/local/bin ${GOLANGCI_LINT_TAG}

RUN GOBIN=/usr/local/bin go get -v \
github.com/tebeka/go2xunit \
github.com/axw/gocov/... \
github.com/AlekSi/gocov-xml \
github.com/wadey/gocovmerge \
&& go clean -cache && rm -rf /root/go

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
gettext-base \
imagemagick \
python-scour \
nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
yarn \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /build

ENV GOCACHE=/tmp/go-build
ENV GOPATH=""
ENV HOME=/tmp

CMD ["make", "DATE=reproducible"]
Loading

0 comments on commit d56d40d

Please sign in to comment.