Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit fcf6e90

Browse files
committed
Added circleci config and make targets. Added note to README.
1 parent afc343d commit fcf6e90

File tree

6 files changed

+272
-78
lines changed

6 files changed

+272
-78
lines changed

.circleci/config.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
version: 2.1
2+
3+
jobs:
4+
build:
5+
docker:
6+
- image: circleci/golang:1.11-node
7+
working_directory: /go/src/github.com/LF-Engineering/aws-lambda-go-api-proxy
8+
steps:
9+
- checkout
10+
- restore_cache:
11+
name: Restore Cache
12+
keys:
13+
- dep-packages-{{ checksum "Gopkg.lock" }}
14+
- run:
15+
name: Setup Dependencies
16+
command: make setup
17+
- run:
18+
name: Download dependencies
19+
command: make deps
20+
- run:
21+
name: Build
22+
command: make build
23+
- run:
24+
name: Test
25+
command: make test
26+
#- run:
27+
# name: Lint
28+
# command: make lint
29+
- save_cache:
30+
name: Save Dep Cache
31+
key: dep-packages-{{ checksum "Gopkg.lock" }}
32+
paths:
33+
- vendor
34+
- node_modules
35+
- persist_to_workspace:
36+
root: ./
37+
paths:
38+
- bin
39+
- vendor
40+
41+
workflows:
42+
version: 2.1
43+
build_and deploy:
44+
jobs:
45+
- build:
46+
filters:
47+
tags:
48+
only: /.*/
49+

.golangci.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# More info on config here: https://github.com/golangci/golangci-lint#config-file
2+
run:
3+
deadline: 5m
4+
issues-exit-code: 1
5+
tests: true
6+
skip-dirs:
7+
- .git
8+
- bin
9+
- vendor
10+
- node_modules
11+
- var
12+
- gen
13+
- tmp
14+
skip-files:
15+
- \.pb\.go$
16+
- \.pb\.goclay\.go$
17+
18+
output:
19+
format: colored-line-number
20+
print-issued-lines: true
21+
print-linter-name: true
22+
23+
linters-settings:
24+
errcheck:
25+
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
26+
# default is false: such cases aren't reported by default.
27+
check-type-assertions: true
28+
29+
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
30+
# default is false: such cases aren't reported by default.
31+
check-blank: true
32+
govet:
33+
check-shadowing: true
34+
golint:
35+
min-confidence: 0
36+
dupl:
37+
threshold: 100
38+
goconst:
39+
min-len: 2
40+
min-occurrences: 2
41+
maligned:
42+
# print struct with more effective memory layout or not, false by default
43+
suggest-new: true
44+
45+
linters:
46+
disable-all: true
47+
enable:
48+
- golint
49+
- govet
50+
- errcheck
51+
- deadcode
52+
- structcheck
53+
- varcheck
54+
- ineffassign
55+
- typecheck
56+
- goconst
57+
- gocyclo
58+
- gofmt
59+
- goimports
60+
- gosec
61+
- megacheck # (staticcheck + gosimple + unused in one linter)
62+
- depguard
63+
- unconvert
64+
- unparam
65+
- unused
66+
- nakedret
67+
- maligned
68+
#- dupl
69+
70+
issues:
71+
exclude-use-default: false
72+
exclude:
73+
# _ instead of err checks
74+
- G104
75+
# for "public interface + private struct implementation" cases only!
76+
- exported func * returns unexported type *, which can be annoying to use
77+
# can be removed in the development phase
78+
# - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)
79+
# not for the active development - can be removed in the stable phase
80+
- should have a package comment, unless it's in another file for this package
81+
- don't use an underscore in package name
82+
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
83+
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv|.*Rollback). is not checked
84+
- should check returned error before deferring

0 commit comments

Comments
 (0)