Skip to content

Commit

Permalink
feat: add workflows and .golangci.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenz Herzberger <[email protected]>
  • Loading branch information
LaurentMontBlanc committed Apr 3, 2024
1 parent fd4448a commit f99ee8c
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Audit

on: [push]

jobs:
audit:
uses: rddl-network/github-actions/.github/workflows/audit.yaml@main
30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Release

on:
workflow_dispatch:
inputs:
tag:
description: "Tag"
required: true
default: ""
prerelease:
type: choice
description: "Pre-Release?"
required: true
options:
- true
- false
default: true
files:
description: "Files"
required: true
default: "rddl-prometheus-exporter"

jobs:
release:
uses: rddl-network/github-actions/.github/workflows/release.yaml@main
with:
tag: ${{ github.event.inputs.tag }}
prerelease: ${{ fromJSON(github.event.inputs.prerelease) }}
files: ${{ github.event.inputs.files }}
87 changes: 87 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
run:
timeout: 5m
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- decorder
- dogsled
- dupl
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exportloopref
- forcetypeassert
- ginkgolinter
- gocheckcompilerdirectives
- gochecksumtype
- gocognit
- goconst
- gocritic
- gocyclo
- gofmt
- goheader
- gomodguard
- goprintffuncname
- gosimple
- gosmopolitan
- govet
- grouper
- importas
- ineffassign
- interfacebloat
- loggercheck
- makezero
- mirror
- misspell
- musttag
- nakedret
- nestif
- nilnil
- noctx
- nolintlint
- nosprintfhostport
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- sqlclosecheck
- staticcheck
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- tparallel
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
linters-settings:
nakedret:
max-func-lines: 100
tagalign:
strict: true
tagliatelle:
case:
use-field-name: true
rules:
json: kebab
2 changes: 1 addition & 1 deletion cmd/rddl-prometheus-exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func main() {

for _, wallet := range strings.Split(cfg.Wallets, ",") {
wallet = strings.TrimSpace(wallet)
sanitizedWallet := strings.Replace(wallet, "-", "_", -1)
sanitizedWallet := strings.ReplaceAll(wallet, "-", "_")
logger.Printf("registering gauge for wallet: " + wallet)
setGauge("balance_"+sanitizedWallet, "Bitcoin balance for network relevant wallet: "+wallet, "elementsd", "wallets", func() float64 {
res, err := elements.GetBalance(cfg.GetElementsURL(wallet), []string{})
Expand Down

0 comments on commit f99ee8c

Please sign in to comment.