Skip to content

Commit 43cb2ed

Browse files
chore: add CI, Makefile, linter config, etc. (#2)
1 parent 58dbde3 commit 43cb2ed

12 files changed

Lines changed: 318 additions & 2 deletions

.clconfig.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"categories": [
3+
"all",
4+
"ci",
5+
"cli",
6+
"test"
7+
],
8+
"change_types": [
9+
{
10+
"short": "feat",
11+
"long": "Features"
12+
},
13+
{
14+
"short": "imp",
15+
"long": "Improvements"
16+
},
17+
{
18+
"short": "fix",
19+
"long": "Bug Fixes"
20+
}
21+
],
22+
"commit_message": "add changelog entry",
23+
"changelog_path": "CHANGELOG.md",
24+
"expected_spellings": {
25+
"CI": "ci",
26+
"CLI": "cli"
27+
},
28+
"legacy_version": null,
29+
"target_repo": "https://github.com/noble-assets/orbgen"
30+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Changelog Diff
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions: read-all
9+
10+
jobs:
11+
check_diff:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check changelog for changes
15+
uses: tarides/changelog-check-action@v2
16+
with:
17+
changelog: CHANGELOG.md
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Changelog Linter
2+
3+
on:
4+
pull_request:
5+
6+
permissions: read-all
7+
8+
jobs:
9+
lint-changelog:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out the repository
14+
uses: actions/checkout@v4
15+
16+
- name: Run changelog linter
17+
uses: MalteHerrmann/changelog-lint-action@v0.3.0

.github/workflows/golangci.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Lint codebase
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
permissions: read-all
9+
10+
jobs:
11+
golangci:
12+
name: lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v4
17+
18+
19+
- name: Setup Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version-file: go.mod
23+
24+
- name: golangci-lint
25+
uses: golangci/golangci-lint-action@v8
26+
with:
27+
version: v2.2.2
28+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Markdown Link Check
2+
on:
3+
pull_request:
4+
jobs:
5+
link-check:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: gaurav-nelson/github-action-markdown-link-check@1.0.15

.github/workflows/spell-check.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Spell Check
2+
on:
3+
pull_request:
4+
paths:
5+
- '**/*.md'
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
spellcheck:
12+
name: Run codespell
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.x'
21+
- name: Install codespell
22+
run: pip install codespell
23+
- name: Run codespell for codebase
24+
run: codespell --skip="*/go.mod,*/go.sum"
25+
- name: Run codespell for doc
26+
run: |
27+
codespell README.md

.github/workflows/vuln_nancy.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Scan Vulnerabilities
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'go.mod'
7+
- 'go.sum'
8+
9+
jobs:
10+
nancy-scan:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version-file: go.mod
21+
22+
- name: Run Nancy vulnerability scanner
23+
run: make nancy
24+
25+
vulncheck:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
32+
- name: Set up Go
33+
uses: actions/setup-go@v5
34+
with:
35+
go-version-file: go.mod
36+
37+
- name: Run vulncheck
38+
run: go tool govulncheck ./...

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@ go.work.sum
2828
.env
2929

3030
# Editor/IDE
31-
# .idea/
32-
# .vscode/
31+
.idea/
32+
.vscode/
33+
34+
# Build
35+
build/

.golangci.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
version: '2'
2+
run:
3+
allow-parallel-runners: true
4+
linters:
5+
default: standard
6+
enable:
7+
- containedctx
8+
- contextcheck
9+
- dupword
10+
- embeddedstructfieldcheck
11+
- errchkjson
12+
- errname
13+
- errorlint
14+
- exhaustive
15+
- forcetypeassert
16+
- funcorder
17+
- goconst
18+
- gocritic
19+
- godot
20+
- godox
21+
- gosec
22+
- misspell
23+
- intrange
24+
- musttag
25+
- makezero
26+
- nilerr
27+
- nilnesserr
28+
- nilnil
29+
- nlreturn
30+
- noctx
31+
- nolintlint
32+
# - paralleltest
33+
- prealloc
34+
- protogetter
35+
- predeclared
36+
- recvcheck
37+
- thelper
38+
# - tparallel
39+
- unconvert
40+
- unparam
41+
- whitespace
42+
# - wrapcheck
43+
settings:
44+
goconst:
45+
min-occurrences: 2
46+
numbers: true
47+
govet:
48+
disable:
49+
- fieldalignment
50+
- shadow
51+
enable-all: true
52+
exclusions:
53+
paths:
54+
- .*\.pb\.go
55+
- .*\.pulsar\.go
56+
- api/
57+
formatters:
58+
enable:
59+
- gci
60+
- gofmt
61+
- gofumpt
62+
- golines
63+
settings:
64+
gci:
65+
sections:
66+
- standard
67+
- default
68+
- prefix(github.com/cosmos/,cosmossdk.io/,github.com/cometbft/)
69+
- blank
70+
- dot
71+
- localmodule
72+
custom-order: true
73+
no-inline-comments: true
74+
no-prefix-comments: true
75+
gofmt:
76+
rewrite-rules:
77+
- pattern: 'interface{}'
78+
replacement: 'any'
79+
golines:
80+
shorten-comments: true

.nancy-ignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CVE-2023-42319 - go-ethereum vulnerability - inherent to protocol, low risk
2+
CVE-2023-42319
3+
4+
# CVE-2015-20112 - go-ethereum old vulnerability - low severity, affects private networks only
5+
CVE-2015-20112
6+
7+
# CVE-2021-43668 - goleveldb vulnerability - affects go-ethereum nodes
8+
CVE-2021-43668

0 commit comments

Comments
 (0)