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

Commit 65399ca

Browse files
authored
New API (#54)
1 parent 77567f8 commit 65399ca

19 files changed

+561
-303
lines changed

.github/workflows/build.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
go-version: [ '1.18' ]
33+
go-version:
34+
- '1.18'
35+
- '1.19'
3436
runs-on: ubuntu-latest
3537
steps:
3638
- uses: actions/checkout@v3

.golangci.yml

+17-22
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
linters-settings:
2+
gocyclo:
3+
min-complexity: 15
24
goimports:
35
local-prefixes: github.com/pellared/fluentassert
4-
golint:
5-
min-confidence: 0
66
govet:
77
check-shadowing: true
88
misspell:
@@ -12,43 +12,38 @@ linters-settings:
1212
allow-unused: false # report any unused nolint directives
1313
require-explanation: true # require an explanation for nolint directives
1414
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
15+
revive:
16+
confidence: 0
1517

1618
linters:
1719
# please, do not use `enable-all`: it's deprecated and will be removed soon.
1820
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
1921
disable-all: true
2022
enable:
21-
- deadcode
23+
- dogsled
2224
- errcheck
23-
# - gosimple
24-
- govet
25-
- ineffassign
26-
# - staticcheck
27-
# - structcheck
28-
- typecheck
29-
# - unused
30-
- varcheck
31-
- depguard
32-
- dupl
3325
- exportloopref
34-
- funlen
35-
- gci
36-
- gocognit
37-
- goconst
26+
- gochecknoinits
3827
- gocritic
28+
- goconst
3929
- gocyclo
40-
- godot
4130
- gofumpt
31+
- goimports
4232
- revive
4333
- gomnd
4434
- goprintffuncname
4535
- gosec
46-
- ifshort
36+
- gosimple
37+
- govet
38+
- ineffassign
39+
- misspell
4740
- nolintlint
48-
# - stylecheck
49-
- thelper
41+
- staticcheck
42+
- stylecheck
43+
- typecheck
5044
- unconvert
51-
# - unparam
45+
- unparam
46+
- unused
5247
- whitespace
5348

5449
issues:

.markdownlint.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Default state for all rules
2+
default: true
3+
4+
# hard-tabs
5+
MD010: false
6+
7+
# 80 char line-length
8+
MD013:
9+
code_blocks: false
10+
tables: false
11+
12+
# no-duplicate-header
13+
MD024:
14+
siblings_only: true

.vscode/settings.json

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
{
2-
// gopls with gofumpt and import ordering
3-
"go.useLanguageServer": true,
4-
"gopls": {
5-
"gofumpt": true,
6-
},
72
"[go]": {
83
"editor.formatOnSave": true,
94
"editor.codeActionsOnSave": {
@@ -16,10 +11,12 @@
1611
"source.organizeImports": true,
1712
},
1813
},
19-
20-
// golangci-lint
14+
"gopls": {
15+
"formatting.local": "github.com/pellared/fluentassert",
16+
"formatting.gofumpt": true,
17+
},
2118
"go.lintTool": "golangci-lint",
2219
"go.lintFlags": [
2320
"--fast"
24-
]
21+
],
2522
}

CODE_OF_CONDUCT.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ members of the project's leadership.
6767

6868
## Attribution
6969

70-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
71+
version 1.4, available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>.
7272

7373
[homepage]: https://www.contributor-covenant.org
7474

7575
For answers to common questions about this code of conduct, see
76-
https://www.contributor-covenant.org/faq
76+
<https://www.contributor-covenant.org/faq>.

build/build.go

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package main
22

33
import (
4+
"fmt"
5+
"os"
6+
47
"github.com/goyek/goyek"
58
"github.com/mattn/go-shellwords"
69
)
@@ -16,9 +19,10 @@ func flow() *goyek.Flow {
1619

1720
test := flow.Register(taskTest())
1821
lint := flow.Register(taskLint())
22+
markdownlint := flow.Register(taskMarkdownLint())
1923
misspell := flow.Register(taskMisspell())
2024
all := flow.Register(taskAll(goyek.Deps{
21-
test, lint, misspell,
25+
test, lint, markdownlint, misspell,
2226
}))
2327

2428
flow.DefaultTask = all
@@ -46,6 +50,24 @@ func taskLint() goyek.Task {
4650
}
4751
}
4852

53+
func taskMarkdownLint() goyek.Task {
54+
return goyek.Task{
55+
Name: "markdownlint",
56+
Usage: "markdownlint-cli (requires docker)",
57+
Action: func(tf *goyek.TF) {
58+
curDir, err := os.Getwd()
59+
if err != nil {
60+
tf.Fatal(err)
61+
}
62+
dockerTag := "markdownlint-cli"
63+
buildCmd := fmt.Sprintf("docker build -t %s -f build/markdownlint-cli.dockerfile .", dockerTag)
64+
Exec(tf, "", buildCmd)
65+
runCmd := fmt.Sprintf("docker run --rm -v %s:/workdir %s *.md", curDir, dockerTag)
66+
Exec(tf, "", runCmd)
67+
},
68+
}
69+
}
70+
4971
func taskMisspell() goyek.Task {
5072
return goyek.Task{
5173
Name: "misspell",

build/markdownlint-cli.dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM ghcr.io/igorshubovych/markdownlint-cli:v0.32.2

f/assert.go

-113
This file was deleted.

f/assert_test.go

-75
This file was deleted.

f/doc.go

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Package f contains convenience assertion functions.
2+
package f

0 commit comments

Comments
 (0)