Skip to content

Commit b950640

Browse files
authored
replace bou.ke/monkey (#1)
1 parent d139df5 commit b950640

29 files changed

+760
-401
lines changed

.github/FUNDING.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [Eun] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: eun # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/PULL_REQUEST_TEMPLATE.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Description
2+
3+
## Problem
4+
A short description of the problem this PR is addressing.
5+
6+
## Solution
7+
A short description of the chosen method to resolve the problem
8+
with an overview of the logic and implementation details when needed.
9+
10+
## Notes
11+
Other notes that you want to share but do not fit into _Problem_ or _Solution_.
12+
13+
<!--
14+
Bumping
15+
Any commit message that includes #major, #minor, or #patch will trigger the respective version bump.
16+
If two or more are present, the highest-ranking one will take precedence.
17+
If no #major, #minor or #patch tag is contained in the commit messages, it will bump patch.
18+
-->

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "04:00"
8+
open-pull-requests-limit: 10

.github/workflows/ci.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
on:
3+
push:
4+
jobs:
5+
golangci-lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
-
9+
uses: actions/checkout@v2
10+
-
11+
name: lint
12+
continue-on-error: false
13+
uses: golangci/golangci-lint-action@v2
14+
with:
15+
version: latest
16+
# Optional: show only new issues if it's a pull request. The default value is `false`.
17+
# only-new-issues: true
18+
19+
vulns:
20+
name: Vulnerability scanner
21+
runs-on: ubuntu-latest
22+
steps:
23+
-
24+
uses: actions/checkout@v2
25+
-
26+
uses: actions/setup-go@v2
27+
# We cannot use nancy-github-action because it is outdated, so it's better to use the latest
28+
# docker image for the validation
29+
-
30+
name: nancy
31+
run: go list -json -m all | docker run -i sonatypecommunity/nancy:latest
32+
33+
test:
34+
strategy:
35+
matrix:
36+
go-version: [1.14.x, 1.15.x]
37+
platform: [ubuntu-latest, macos-latest, windows-latest]
38+
runs-on: ${{ matrix.platform }}
39+
steps:
40+
-
41+
name: Install Go
42+
uses: actions/setup-go@v1
43+
with:
44+
go-version: ${{ matrix.go-version }}
45+
-
46+
name: Checkout code
47+
uses: actions/checkout@v2
48+
-
49+
name: Test
50+
run: go test -v -count=1 -coverprofile="coverage-${{ matrix.platform }}-${{ matrix.go-version }}.txt" -covermode=atomic
51+
-
52+
name: Send coverage
53+
uses: shogo82148/actions-goveralls@v1
54+
with:
55+
path-to-profile: coverage-${{ matrix.platform }}-${{ matrix.go-version }}.txt
56+
flag-name: ${{ matrix.platform }}-${{ matrix.go-version }}
57+
parallel: true
58+
59+
# notifies that all test jobs are finished.
60+
finish:
61+
needs: test
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: shogo82148/actions-goveralls@v1
65+
with:
66+
parallel-finished: true

.github/workflows/release.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
-
11+
uses: actions/checkout@master
12+
with:
13+
fetch-depth: '0'
14+
-
15+
name: Bump version and push tag
16+
uses: anothrNick/[email protected]
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
WITH_V: true
20+
DEFAULT_BUMP: patch

.golangci.yml

+225
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
linters-settings:
2+
depguard:
3+
list-type: blacklist
4+
include-go-root: false
5+
packages-with-error-message:
6+
- errors: "Use github.com/pkg/errors instead of errors"
7+
dogsled:
8+
# checks assignments with too many blank identifiers; default is 2
9+
max-blank-identifiers: 2
10+
dupl:
11+
# tokens count to trigger issue, 150 by default
12+
threshold: 100
13+
errcheck:
14+
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
15+
# default is false: such cases aren't reported by default.
16+
check-type-assertions: false
17+
18+
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
19+
# default is false: such cases aren't reported by default.
20+
check-blank: false
21+
22+
# [deprecated] comma-separated list of pairs of the form pkg:regex
23+
# the regex is used to ignore names within pkg. (default "fmt:.*").
24+
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
25+
ignore: fmt:.*
26+
27+
exhaustive:
28+
# indicates that switch statements are to be considered exhaustive if a
29+
# 'default' case is present, even if all enum members aren't listed in the
30+
# switch
31+
default-signifies-exhaustive: true
32+
funlen:
33+
lines: 100
34+
statements: 50
35+
gci:
36+
# put imports beginning with prefix after 3rd-party packages;
37+
# only support one prefix
38+
# if not set, use goimports.local-prefixes
39+
local-prefixes: github.com/Eun/go-test-buckets
40+
gocognit:
41+
# minimal code complexity to report, 30 by default (but we recommend 10-20)
42+
min-complexity: 30
43+
nestif:
44+
# minimal complexity of if statements to report, 5 by default
45+
min-complexity: 5
46+
goconst:
47+
# minimal length of string constant, 3 by default
48+
min-len: 3
49+
# minimal occurrences count to trigger, 3 by default
50+
min-occurrences: 3
51+
gocritic:
52+
enabled-tags:
53+
- diagnostic
54+
- experimental
55+
- opinionated
56+
- performance
57+
- style
58+
disabled-checks:
59+
- dupImport # https://github.com/go-critic/go-critic/issues/845
60+
- ifElseChain
61+
- octalLiteral
62+
- whyNoLint
63+
- wrapperFunc
64+
gocyclo:
65+
# minimal code complexity to report, 30 by default (but we recommend 10-20)
66+
min-complexity: 30
67+
godot:
68+
# check all top-level comments, not only declarations
69+
check-all: false
70+
gofmt:
71+
# simplify code: gofmt with `-s` option, true by default
72+
simplify: true
73+
goimports:
74+
# put imports beginning with prefix after 3rd-party packages;
75+
# it's a comma-separated list of prefixes
76+
local-prefixes: github.com/Eun/go-test-buckets
77+
golint:
78+
# minimal confidence for issues, default is 0.8
79+
min-confidence: 0.8
80+
gomnd:
81+
settings:
82+
mnd:
83+
# the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
84+
checks: argument,case,condition,operation,return,assign
85+
govet:
86+
# report about shadowed variables
87+
check-shadowing: true
88+
89+
# settings per analyzer
90+
settings:
91+
printf: # analyzer name, run `go tool vet help` to see all analyzers
92+
funcs: # run `go tool vet help printf` to see available settings for `printf` analyzer
93+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
94+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
95+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
96+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
97+
lll:
98+
# max line length, lines longer will be reported. Default is 120.
99+
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
100+
line-length: 140
101+
# tab width in spaces. Default to 1.
102+
tab-width: 1
103+
misspell:
104+
# Correct spellings using locale preferences for US or UK.
105+
# Default is to use a neutral variety of English.
106+
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
107+
locale: US
108+
nakedret:
109+
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
110+
max-func-lines: 30
111+
prealloc:
112+
simple: true
113+
range-loops: true # Report preallocation suggestions on range loops, true by default
114+
for-loops: false # Report preallocation suggestions on for loops, false by default
115+
nolintlint:
116+
# Enable to ensure that nolint directives are all used. Default is true.
117+
allow-unused: false
118+
# Disable to ensure that nolint directives don't have a leading space. Default is true.
119+
allow-leading-space: true
120+
# Exclude following linters from requiring an explanation. Default is [].
121+
allow-no-explanation: []
122+
# Enable to require an explanation of nonzero length after each nolint directive. Default is false.
123+
require-explanation: true
124+
# Enable to require nolint directives to mention the specific linter being suppressed. Default is false.
125+
require-specific: true
126+
unparam:
127+
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
128+
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
129+
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
130+
# with golangci-lint call it on a directory with the changed file.
131+
check-exported: false
132+
unused:
133+
# treat code as a program (not a library) and report unused exported identifiers; default is false.
134+
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
135+
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
136+
# with golangci-lint call it on a directory with the changed file.
137+
check-exported: false
138+
139+
linters:
140+
disable-all: true
141+
enable:
142+
- bodyclose
143+
- deadcode
144+
- depguard
145+
- dogsled
146+
- dupl
147+
- errcheck
148+
- exhaustive
149+
- funlen
150+
- gochecknoinits
151+
- gocognit
152+
- goconst
153+
- gocritic
154+
- gocyclo
155+
- godot
156+
- gofmt
157+
- goimports
158+
- golint
159+
- gomnd
160+
- goprintffuncname
161+
- gosec
162+
- gosimple
163+
- govet
164+
- ineffassign
165+
- lll
166+
- misspell
167+
- nestif
168+
- nakedret
169+
- noctx
170+
- nolintlint
171+
- prealloc
172+
- rowserrcheck
173+
- scopelint
174+
- staticcheck
175+
- structcheck
176+
- stylecheck
177+
- typecheck
178+
- unconvert
179+
- unparam
180+
- unused
181+
- varcheck
182+
- whitespace
183+
184+
185+
issues:
186+
# Independently from option `exclude` we use default exclude patterns,
187+
# it can be disabled by this option. To list all
188+
# excluded by default patterns execute `golangci-lint run --help`.
189+
# Default value for this option is true.
190+
exclude-use-default: false
191+
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
192+
max-issues-per-linter: 0
193+
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
194+
max-same-issues: 0
195+
196+
exclude-rules:
197+
# Exclude some linters from running on tests files.
198+
- path: _test\.go
199+
linters:
200+
- gocyclo
201+
- errcheck
202+
- dupl
203+
- gosec
204+
- funlen
205+
- goconst
206+
- scopelint
207+
- gocognit
208+
- lll
209+
- text: 'shadow: declaration of "err" shadows declaration at line \d+'
210+
linters:
211+
- govet
212+
- text: "don't use an underscore in package name"
213+
linters:
214+
- golint
215+
- text: "should not use underscores in package names"
216+
linters:
217+
- stylecheck
218+
219+
220+
# golangci.com configuration
221+
# https://github.com/golangci/golangci/wiki/Configuration
222+
service:
223+
golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly
224+
prepare:
225+
- echo "here I can run custom commands, but no preparation needed for this repo"

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/Eun/go-test-buckets
22

33
go 1.12
44

5-
require bou.ke/monkey v1.0.2
5+
require github.com/agiledragon/gomonkey/v2 v2.1.0

go.sum

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1-
bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI=
2-
bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA=
1+
github.com/agiledragon/gomonkey/v2 v2.1.0 h1:+5Dbq8a1fn89IgVk35O233R41FH0nBKFPn50wDZpNs0=
2+
github.com/agiledragon/gomonkey/v2 v2.1.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
3+
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
4+
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
5+
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
6+
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
7+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
8+
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
9+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
10+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
11+
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=

0 commit comments

Comments
 (0)