Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
Signed-off-by: bytemare <[email protected]>
  • Loading branch information
bytemare committed Jul 30, 2024
1 parent a5ded8b commit f5b849f
Show file tree
Hide file tree
Showing 19 changed files with 731 additions and 0 deletions.
280 changes: 280 additions & 0 deletions .github/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
linters:
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
- cyclop
- 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
- gofmt
- gofumpt
- goheader
- goimports
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- importas
- inamedparam
- ineffassign
- interfacebloat
- intrange
- ireturn
- lll
- loggercheck
- maintidx
- makezero
- 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
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
#- varnamelen
- wastedassign
- whitespace
- wrapcheck
- wsl
- zerologlint

linters-settings:
cyclop:
max-complexity: 11
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: 16
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- unnamedResult
gocyclo:
min-complexity: 15
godox:
keywords:
- NOTE
- OPTIMIZE
- HACK
- TODO
- todo
gofmt:
simplify: true
goimports:
local-prefixes: github.com/bytemare/frost
gosimple:
checks: [ "all" ]
govet:
settings:
shadow:
strict: true
disable-all: true
enable:
- asmdecl
- assign
- atomic
- atomicalign
- 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
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
whitespace:
multi-if: false
multi-func: false
wsl:
# Allow declarations (var) to be cuddled.
allow-cuddle-declarations: true
# Allow trailing comments in ending of blocks
allow-trailing-comment: false
# Force newlines in end of case at this limit (0 = never).
force-case-trailing-whitespace: 0
# Force cuddling of err checks with err var assignment
force-err-cuddling: true
# Allow leading comments to be separated with empty liens
allow-separated-leading-comment: false

issues:
# List of regexps of issue texts to exclude, empty list by default.
# 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"
#- "do not define dynamic errors, use wrapped static errors instead"
#- "missing cases in switch of type Group: maxID"

#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 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.
exclude-use-default: false

run:
tests: false

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


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

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
38 changes: 38 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# How to contribute

### Did you find a bug? 🐞

* 🔎 Please ensure your findings have not already been reported by searching on the project repository under [Issues](https://github.com/bytemare/frost).
* If you think your findings can be complementary to an existing issue, don't hesitate to join the conversation 😃☕
* If there's no issue addressing the problem, [open a new one](https://github.com/bytemare/frost/issues/new). Please be clear in the title and description, and add relevant information. Bonus points if you provide a **code sample** and everything needed to reproduce the issue when expected behaviour is not occurring.
* If possible, use the relevant issue templates.

### Do you have a fix?

🎉 That's awesome! Pull requests are welcome!

* Please [open an issue](https://github.com/bytemare/frost) beforehand, so we can discuss this.
* Fork this repo from `main`, and ensure your fork is up-to-date with it when submitting the PR.
* If your changes impact the documentation, please update it accordingly.
* If you added code that impact tests, please add tests with relevant coverage and test cases. Bonus points for fuzzing.
* 🛠️ Make sure the test suite passes.

If your changes might have an impact on performance, please benchmark your code and measure the impact, share the results and the tests that lead to these results.

Please note that changes that are purely cosmetic and do not add anything substantial to the stability, functionality, or testability of the project may not be accepted.

### Coding Convention

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](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:
Loading

0 comments on commit f5b849f

Please sign in to comment.