Skip to content

Commit e8ca009

Browse files
authored
Merge pull request #1 from romdo/add-rawmessage
feat(parser): implement RawMessage
2 parents 8b330a6 + ce4b06f commit e8ca009

File tree

12 files changed

+2205
-0
lines changed

12 files changed

+2205
-0
lines changed

.github/workflows/ci.yml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
---
2+
name: CI
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: golangci-lint
12+
uses: golangci/golangci-lint-action@v2
13+
with:
14+
version: v1.41
15+
env:
16+
VERBOSE: "true"
17+
18+
tidy:
19+
name: Tidy
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: actions/setup-go@v2
24+
with:
25+
go-version: 1.15
26+
- uses: actions/cache@v2
27+
with:
28+
path: ~/go/pkg/mod
29+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
30+
restore-keys: |
31+
${{ runner.os }}-go-
32+
- name: Check if mods are tidy
33+
run: make check-tidy
34+
35+
benchmark:
36+
name: Benchmarks
37+
runs-on: ubuntu-latest
38+
if: github.ref != 'refs/heads/main'
39+
steps:
40+
- uses: actions/checkout@v2
41+
- uses: actions/setup-go@v2
42+
with:
43+
go-version: 1.15
44+
- uses: actions/cache@v2
45+
with:
46+
path: ~/go/pkg/mod
47+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
48+
restore-keys: |
49+
${{ runner.os }}-go-
50+
- name: Run benchmarks
51+
run: make bench | tee output.raw
52+
- name: Fix benchmark names
53+
run: >-
54+
perl -pe 's/^(Benchmark.+?)\/(\S+)(-\d+)(\s+)/\1__\2\4/' output.raw |
55+
tr '-' '_' | tee output.txt
56+
- name: Announce benchmark result
57+
uses: rhysd/github-action-benchmark@v1
58+
with:
59+
tool: "go"
60+
output-file-path: output.txt
61+
fail-on-alert: true
62+
comment-on-alert: true
63+
github-token: ${{ secrets.GITHUB_TOKEN }}
64+
auto-push: false
65+
66+
cov:
67+
name: Coverage
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v2
71+
- uses: actions/setup-go@v2
72+
with:
73+
go-version: 1.15
74+
- uses: actions/cache@v2
75+
with:
76+
path: ~/go/pkg/mod
77+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
78+
restore-keys: |
79+
${{ runner.os }}-go-
80+
- name: Publish coverage
81+
uses: paambaati/codeclimate-action@v2.7.4
82+
env:
83+
VERBOSE: "true"
84+
GOMAXPROCS: 4
85+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
86+
with:
87+
coverageCommand: make cov
88+
prefix: github.com/${{ github.repository }}
89+
coverageLocations: |
90+
${{ github.workspace }}/coverage.out:gocov
91+
92+
test:
93+
name: Test
94+
runs-on: ubuntu-latest
95+
strategy:
96+
fail-fast: false
97+
matrix:
98+
go_version:
99+
- "1.15"
100+
- "1.16"
101+
steps:
102+
- uses: actions/checkout@v2
103+
- uses: actions/setup-go@v2
104+
with:
105+
go-version: ${{ matrix.terraform_version }}
106+
- uses: actions/cache@v2
107+
with:
108+
path: ~/go/pkg/mod
109+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
110+
restore-keys: |
111+
${{ runner.os }}-go-
112+
- name: Run tests
113+
run: make test
114+
env:
115+
VERBOSE: "true"
116+
117+
benchmark-store:
118+
name: Store benchmarks
119+
runs-on: ubuntu-latest
120+
if: github.ref == 'refs/heads/main'
121+
steps:
122+
- uses: actions/checkout@v2
123+
- uses: actions/setup-go@v2
124+
with:
125+
go-version: 1.15
126+
- uses: actions/cache@v2
127+
with:
128+
path: ~/go/pkg/mod
129+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
130+
restore-keys: |
131+
${{ runner.os }}-go-
132+
- name: Run benchmarks
133+
run: make bench | tee output.raw
134+
- name: Fix benchmark names
135+
run: >-
136+
perl -pe 's/^(Benchmark.+?)\/(\S+)(-\d+)(\s+)/\1__\2\4/' output.raw |
137+
tr '-' '_' | tee output.txt
138+
- name: Store benchmark result
139+
uses: rhysd/github-action-benchmark@v1
140+
with:
141+
tool: "go"
142+
output-file-path: output.txt
143+
github-token: ${{ secrets.ROMDOBOT_TOKEN }}
144+
comment-on-alert: true
145+
auto-push: true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/*.tidy-check
2+
/bin/*
3+
/coverage.out
4+
/output.txt

.golangci.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
linters-settings:
2+
funlen:
3+
lines: 100
4+
statements: 150
5+
goconst:
6+
min-occurrences: 5
7+
gocyclo:
8+
min-complexity: 20
9+
golint:
10+
min-confidence: 0
11+
govet:
12+
check-shadowing: true
13+
enable-all: true
14+
disable:
15+
- fieldalignment
16+
lll:
17+
line-length: 80
18+
tab-width: 4
19+
maligned:
20+
suggest-new: true
21+
misspell:
22+
locale: US
23+
24+
linters:
25+
disable-all: true
26+
enable:
27+
- asciicheck
28+
- bodyclose
29+
- deadcode
30+
- depguard
31+
- dupl
32+
- durationcheck
33+
- errcheck
34+
- errorlint
35+
- exhaustive
36+
- exportloopref
37+
- funlen
38+
- gochecknoinits
39+
- goconst
40+
- gocritic
41+
- gocyclo
42+
- godot
43+
- gofumpt
44+
- goimports
45+
- goprintffuncname
46+
- gosec
47+
- gosimple
48+
- govet
49+
- importas
50+
- ineffassign
51+
- lll
52+
- misspell
53+
- nakedret
54+
- nilerr
55+
- noctx
56+
- nolintlint
57+
- prealloc
58+
- predeclared
59+
- revive
60+
- rowserrcheck
61+
- sqlclosecheck
62+
- staticcheck
63+
- structcheck
64+
- tparallel
65+
- typecheck
66+
- unconvert
67+
- unparam
68+
- unused
69+
- varcheck
70+
- wastedassign
71+
- whitespace
72+
73+
issues:
74+
exclude:
75+
- Using the variable on range scope `tt` in function literal
76+
- Using the variable on range scope `tc` in function literal
77+
exclude-rules:
78+
- path: "_test\\.go"
79+
linters:
80+
- funlen
81+
- dupl
82+
- goconst
83+
- source: "^//go:generate "
84+
linters:
85+
- lll
86+
- source: "`json:"
87+
linters:
88+
- lll
89+
90+
run:
91+
timeout: 2m
92+
allow-parallel-runners: true
93+
modules-download-mode: readonly

0 commit comments

Comments
 (0)