Skip to content

Commit

Permalink
Various updates and enhancements (#15)
Browse files Browse the repository at this point in the history
* various enhancements, updates, optimizations, serde, and dependency upgrades

---------

Signed-off-by: bytemare <3641580+bytemare@users.noreply.github.com>
Co-authored-by: Daniel Bourdrez <daniel.bourdrez@blablacar.com>
  • Loading branch information
bytemare and dbourdrez authored Oct 8, 2024
1 parent bc6f787 commit 861a1f1
Show file tree
Hide file tree
Showing 50 changed files with 7,592 additions and 1,908 deletions.
199 changes: 142 additions & 57 deletions .github/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,102 +1,142 @@
linters:
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
- cyclop
- deadcode
- decorder
#- depguard
- dogsled
- dupl
- dupword
- durationcheck
#- err113
- errcheck
- errchkjson
- errname
- errorlint
- exhaustive
- exhaustruct
- exportloopref
- fatcontext
- forbidigo
- forcetypeassert
- funlen
- gci
- ginkgolinter
- gocheckcompilerdirectives
#- gochecknoglobals
- gochecknoinits
- gochecksumtype
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- goerr113
- gofmt
- gofumpt
- goheader
- goimports
- gomodguard
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- ifshort
- grouper
- importas
- inamedparam
- ineffassign
- interfacebloat
- intrange
- ireturn
- lll
- loggercheck
- maintidx
- makezero
#- maligned
- megacheck
- mirror
- misspell
#- mnd
- musttag
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
#- nonamedreturns
- nosprintfhostport
- paralleltest
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- structcheck
- stylecheck
#- tagliatelle
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- varcheck
- usestdlibvars
#- varnamelen
- wastedassign
- whitespace
#- wrapcheck
- wrapcheck
- wsl
#- exhaustive
#- exhaustivestruct
#- gci
#- gochecknoglobals
#- gochecknoinits
#- gomnd
#- nlreturn
presets:
- bugs
- unused
fast: false
- zerologlint

linters-settings:
cyclop:
max-complexity: 15
skip-tests: true
dupl:
threshold: 100
errcheck:
check-type-assertions: true
check-blank: true
#exclude-functions:
# - io/ioutil.ReadFile
# - io.Copy(*bytes.Buffer)
# - io.Copy(os.Stdout)
funlen:
lines: 100
statements: 50
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/bytemare/frost) # Custom section: groups all imports with the specified Prefix.
skip-generated: true
# Enable custom order of sections.
# If `true`, make the section order the same as the order of `sections`.
# Default: false
custom-order: true
gocognit:
min-complexity: 15
min-complexity: 16
goconst:
min-len: 2
min-occurrences: 2
Expand All @@ -107,6 +147,9 @@ linters-settings:
- opinionated
- performance
- style
disabled-checks:
- unnamedResult
- sloppyReassign
gocyclo:
min-complexity: 15
godox:
Expand All @@ -120,45 +163,80 @@ linters-settings:
simplify: true
goimports:
local-prefixes: github.com/bytemare/frost
gomnd:
settings:
mnd:
checks:
- argument
- case
- condition
- operation
- return
- assign
gosec:
excludes:
- G115
config:
G602:
frost:
- encodedLength
gosimple:
checks: [ "all" ]
govet:
check-shadowing: true

# settings per analyzer
settings:
printf: # analyzer name, run `go tool vet help` to see all analyzers
funcs: # run `go tool vet help printf` to see available settings for `printf` analyzer
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf

# enable or disable analyzers by name
shadow:
strict: true
disable-all: true
enable:
- asmdecl
- assign
- atomic
- atomicalign
disable-all: false
- bools
- buildtag
- cgocall
- composites
- copylocks
- deepequalerrors
- errorsas
- fieldalignment
- findcall
- framepointer
- httpresponse
- ifaceassert
- loopclosure
- lostcancel
- nilfunc
- nilness
- printf
- reflectvaluecompare
- shadow
- shift
- sigchanyzer
- sortslice
- stdmethods
- stringintconv
- structtag
- testinggoroutine
- tests
- unmarshal
- unreachable
- unsafeptr
- unusedresult
- unusedwrite
lll:
line-length: 120
# tab width ('\t') in spaces. Default to 1.
tab-width: 4
maligned:
suggest-new: true
misspell:
locale: US
mnd:
checks:
- argument
- case
- condition
- operation
- return
- assign
#ignored-functions:
# - 'nist.setMapping'
# - 'big.NewInt'
# - 'hash2curve.HashToFieldXMD'
nlreturn:
block-size: 2
prealloc:
simple: false
for-loops: true
unused:
check-exported: false
whitespace:
multi-if: false
multi-func: false
Expand All @@ -179,18 +257,23 @@ issues:
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
- "should have a package comment, unless it's in another file for this package"
#exclude:
#- "should have a package comment, unless it's in another file for this package"
#- "do not define dynamic errors, use wrapped static errors instead"
#- "missing cases in switch of type Group: maxID"

exclude-rules:
- path: ./*
linters:
- exhaustive
#exclude-rules:
# - path: internal/hash.go
# linters:
# - errcheck
# - path: internal/tag/strings.go
# linters:
# - gosec

max-issues-per-linter: 0
max-same-issues: 0

# Independently from option `exclude` we use default exclude patterns,
# Independently of option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
Expand All @@ -199,5 +282,7 @@ issues:
run:
tests: false

output:
format: github-actions
#output:
# formats:
# - format: github-actions
# show-stats: true
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @bytemare
1 change: 1 addition & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


# Contributor Covenant Code of Conduct [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](code_of_conduct.md)

## Our Pledge
Expand Down
6 changes: 5 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ Please note that changes that are purely cosmetic and do not add anything substa

This project tries to be as Go idiomatic as possible. Conventions from [Effective Go](https://golang.org/doc/effective_go) apply here. Tests use a very opinionated linting configuration that you should use before committing to your changes.

## Governance Model

This project follows the [Benevolent Dictator Governance Model](http://oss-watch.ac.uk/resources/benevolentdictatorgovernancemodel) where the project owner and lead makes all final decisions.

### Licence

By contributing to this project, you agree that your contributions will be licensed under the project's [License](https://github.com/bytemare/template/blob/main/LICENSE).

All contributions (including pull requests) must agree to the [Developer Certificate of Origin (DCO) version 1.1](http://developercertificate.org). It states that the contributor has the right to submit the patch for inclusion into the project. Simply submitting a contribution implies this agreement, however, please include the "Signed-off-by" git tag in every commit (this tag is a conventional way to confirm that you agree to the DCO).
All contributions (including pull requests) must agree to the [Developer Certificate of Origin (DCO) version 1.1](https://developercertificate.org). It states that the contributor has the right to submit the patch for inclusion into the project. Simply submitting a contribution implies this agreement, however, please include the "Signed-off-by" git tag in every commit (this tag is a conventional way to confirm that you agree to the DCO).

Thanks! :heart:
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
blank_issues_enabled: true
contact_links:
- name: Questions, feature requests, and more 💬
url: https://github.com/bytemare/frost/discussions
about: Do you need help? Did you make something with frost? Do you have an idea? Tell us about it!
about: Do you need help? Did you make something with FROST? Do you have an idea? Tell us about it!
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: "📈 Enhancement"
about: Request or discuss improvements
title: "[Enhancement]"
labels: enhancement
assignees: bytemare

---

<!--
Please answer these questions before submitting your issue. Thanks!
-->

### Describe the feature

A clear and concise description of what the enhancement is and what problem it solves.

**Expected behaviour**

A clear and concise description of what you expected to happen.

**Additional context**

Add any other context about the problem here.
Loading

0 comments on commit 861a1f1

Please sign in to comment.