-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit tests, decode logic; tidy repo
- Loading branch information
1 parent
cab779a
commit 8882cf0
Showing
17 changed files
with
2,495 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: 2 | ||
updates: | ||
|
||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
labels: | ||
- "github_actions" | ||
|
||
# Maintain dependencies for top level Go modules | ||
- package-ecosystem: gomod | ||
directory: / | ||
target-branch: "main" | ||
schedule: | ||
interval: weekly | ||
labels: | ||
- "dependencies" | ||
open-pull-requests-limit: 10 | ||
pull-request-branch-name: | ||
separator: "-" | ||
reviewers: | ||
- "zivkovicmilos" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
run: | ||
concurrency: 8 | ||
timeout: 10m | ||
issue-exit-code: 1 | ||
tests: true | ||
skip-dirs-use-default: true | ||
modules-download-mode: readonly | ||
allow-parallel-runners: false | ||
go: "" | ||
|
||
output: | ||
uniq-by-line: false | ||
path-prefix: "" | ||
sort-results: true | ||
|
||
issues: | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
new: false | ||
fix: false | ||
exclude-rules: | ||
- path: (.+)_test.go | ||
linters: | ||
- nilnil | ||
- gosec | ||
- lll | ||
|
||
linters: | ||
fast: false | ||
disable-all: true | ||
enable: | ||
- asasalint # Check for pass []any as any in variadic func(...any) | ||
- asciicheck # Detects funky ASCII characters | ||
- bidichk # Checks for dangerous unicode character sequences | ||
- durationcheck # Check for two durations multiplied together | ||
- errcheck # Forces to not skip error check | ||
- exportloopref # Checks for pointers to enclosing loop variables | ||
- gocritic # Bundles different linting checks | ||
- godot # Checks for periods at the end of comments | ||
- gomoddirectives # Allow or ban replace directives in go.mod | ||
- gosimple # Code simplification | ||
- govet # Official Go tool | ||
- ineffassign # Detects when assignments to existing variables are not used | ||
- nakedret # Finds naked/bare returns and requires change them | ||
- nilerr # Requires explicit returns | ||
- nilnil # Requires explicit returns | ||
- promlinter # Lints Prometheus metrics names | ||
- reassign # Checks that package variables are not reassigned | ||
- revive # Drop-in replacement for golint | ||
- tenv # Detects using os.Setenv instead of t.Setenv | ||
- testableexamples # Checks if examples are testable (have expected output) | ||
- unparam # Finds unused params | ||
- usestdlibvars # Detects the possibility to use variables/constants from stdlib | ||
- wastedassign # Finds wasted assignment statements | ||
- loggercheck # Checks the odd number of key and value pairs for common logger libraries | ||
- nestif # Finds deeply nested if statements | ||
- nonamedreturns # Reports all named returns | ||
- decorder # Check declaration order of types, consts, vars and funcs | ||
- gocheckcompilerdirectives # Checks that compiler directive comments (//go:) are valid | ||
- gochecknoinits # Checks for init methods | ||
- whitespace # Tool for detection of leading and trailing whitespace | ||
- wsl # Forces you to use empty lines | ||
- unconvert # Unnecessary type conversions | ||
- tparallel # Detects inappropriate usage of t.Parallel() method in your Go test codes | ||
- thelper # Detects golang test helpers without t.Helper() call and checks the consistency of test helpers | ||
- stylecheck # Stylecheck is a replacement for golint | ||
- prealloc # Finds slice declarations that could potentially be pre-allocated | ||
- predeclared # Finds code that shadows one of Go's predeclared identifiers | ||
- nolintlint # Ill-formed or insufficient nolint directives | ||
- nlreturn # Checks for a new line before return and branch statements to increase code clarity | ||
- misspell # Misspelled English words in comments | ||
- makezero # Finds slice declarations with non-zero initial length | ||
- lll # Long lines | ||
- importas # Enforces consistent import aliases | ||
- gosec # Security problems | ||
- gofmt # Whether the code was gofmt-ed | ||
- gofumpt # Stricter gofmt | ||
- goimports # Unused imports | ||
- goconst # Repeated strings that could be replaced by a constant | ||
- dogsled # Checks assignments with too many blank identifiers (e.g. x, , , _, := f()) | ||
- errname # Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error | ||
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13 | ||
- unused # Checks Go code for unused constants, variables, functions and types | ||
|
||
linters-settings: | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
disabled-checks: | ||
- hugeParam | ||
- rangeExprCopy | ||
- rangeValCopy | ||
- importShadow | ||
- unnamedResult | ||
errcheck: | ||
check-type-assertions: false | ||
check-blank: true | ||
exclude-functions: | ||
- io/ioutil.ReadFile | ||
- io.Copy(*bytes.Buffer) | ||
- io.Copy(os.Stdout) | ||
nakedret: | ||
max-func-lines: 1 | ||
govet: | ||
enable-all: true | ||
gofmt: | ||
simplify: true | ||
goconst: | ||
min-len: 3 | ||
min-occurrences: 3 | ||
godot: | ||
scope: all | ||
period: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21.x | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v4 | ||
with: | ||
args: | ||
--config=./.github/golangci.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: Go Linter | ||
uses: ./.github/workflows/lint.yaml | ||
|
||
test: | ||
name: Go Test | ||
uses: ./.github/workflows/test.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21.x | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Go test | ||
run: go test -shuffle=on -coverprofile coverage.out -timeout 5m ./... | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
slug: madz-lab/ethrlp | ||
files: coverage.out | ||
verbose: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
test-with-race: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21.x | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Go race test | ||
run: go test -race -shuffle=on -timeout 5m ./... |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.PHONY: lint | ||
lint: | ||
golangci-lint run --config .github/golangci.yaml | ||
|
||
.PHONY: gofumpt | ||
gofumpt: | ||
go install mvdan.cc/gofumpt@latest | ||
gofumpt -l -w . | ||
|
||
.PHONY: fixalign | ||
fixalign: | ||
go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest | ||
fieldalignment -fix $(filter-out $@,$(MAKECMDGOALS)) # the full package name (not path!) |
Oops, something went wrong.