diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8a8a10e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/golang.yml b/.github/workflows/golang.yml new file mode 100644 index 0000000..f329e8a --- /dev/null +++ b/.github/workflows/golang.yml @@ -0,0 +1,23 @@ +--- +name: Golang +"on": + # required by gomod-go-version-updater to trigger this action once pr has + # been reviewed + pull_request_review: + types: [submitted] + push: +permissions: + contents: read + packages: read +jobs: + mcvs-golang-action: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4.2.1 + - uses: schubergphilis/mcvs-golang-action@v0.8.3 + with: + code_coverage_expected: 62.3 + gci: "false" + golang-unit-tests-exclusions: |- + \(cmd\/prolayout\) + golangci-lint-version: v1.61.0 diff --git a/.github/workflows/gomod-go-version-updater.yml b/.github/workflows/gomod-go-version-updater.yml new file mode 100644 index 0000000..c2679fa --- /dev/null +++ b/.github/workflows/gomod-go-version-updater.yml @@ -0,0 +1,14 @@ +--- +name: gomod-go-version-updater-action +"on": + schedule: + - cron: "42 5 * * 1-5" +permissions: + contents: write + pull-requests: write + repository-projects: write +jobs: + gomod-go-version-updater-action: + runs-on: ubuntu-22.04 + steps: + - uses: schubergphilis/gomod-go-version-updater-action@v0.1.5 diff --git a/.github/workflows/mcvs-pr-validation.yml b/.github/workflows/mcvs-pr-validation.yml new file mode 100644 index 0000000..e1fae88 --- /dev/null +++ b/.github/workflows/mcvs-pr-validation.yml @@ -0,0 +1,19 @@ +--- +name: MCVS-PR-validation-action +"on": + pull_request: + types: + - edited + - opened + - reopened + - synchronize + workflow_call: +permissions: + contents: read + pull-requests: read +jobs: + MCVS-PR-validation-action: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4.2.1 + - uses: schubergphilis/mcvs-pr-validation-action@v0.2.0 diff --git a/.gitignore b/.gitignore index 27a3afb..a6932ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +.vscode reports diff --git a/.golangci.yml b/.golangci.yml index dd902be..b0dfc56 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,25 +1,17 @@ +--- run: concurrency: 3 timeout: 15m issues-exit-code: 1 tests: true - - skip-dirs: - - data - # list of build tags, all linters use it. Default is empty list # output configuration options output: - # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: code-climate - # print lines of code with issue, default is true print-issued-lines: true - # print linter name in the end of issue text, default is true print-linter-name: true - uniq-by-line: false # all available settings of specific linters @@ -30,12 +22,14 @@ linters-settings: deny: - pkg: "github.com/tj/assert" desc: not allowed, did you mean testify assert? - gci: - local-prefixes: github.com/wimspaargaren/prolayout + errcheck: check-type-assertions: false - check-foonk: true - + gci: + sections: + - standard # Standard section: captures all standard packages. + - default + - prefix(github.com/wimspaargaren/prolayout) revive: ignore-generated-header: true enable-all-rules: true @@ -79,18 +73,10 @@ linters-settings: disabled: false arguments: - "^[a-z][a-z0-9A-Z]{0,}$" - govet: - check-shadowing: false - - golint: - min-confidence: 0.8 - gofmt: simplify: true gocyclo: min-complexity: 18 - maligned: - suggest-new: true dupl: threshold: 175 goconst: @@ -114,25 +100,19 @@ linters-settings: lll: line-length: 200 tab-width: 2 - unused: - check-exported: false - unparam: check-exported: false - nakedret: max-func-lines: 0 prealloc: simple: true - range-loops: true # Report preallocation suggestions on range loops, true by default - for-loops: false # Report preallocation suggestions on for loops, false by default + range-loops: true + for-loops: false gocritic: disabled-checks: - regexpMust - enabled-tags: - performance - settings: # settings passed to gocritic captLocal: # must be valid enabled check name paramsOnly: true @@ -140,58 +120,22 @@ linters-settings: sizeThreshold: 32 linters: - disable-all: true - enable: - - asciicheck - - bodyclose - - dupl - - errcheck - - errorlint - - exhaustive - - exportloopref - - funlen - - gci - - gochecknoglobals - - gochecknoinits - - gocognit - - goconst - - gocritic - - gocyclo - - godox - - gofmt - - gofumpt - - goheader - - revive - - gomodguard - - goprintffuncname - - gosimple - - govet - - ineffassign - - misspell - - nakedret - - nestif - - noctx - - nolintlint - - rowserrcheck - - sqlclosecheck - - staticcheck - - tparallel - - typecheck - - unconvert - - unparam - - whitespace - - dogsled - - godot - - goerr113 - - goimports - - lll - - prealloc - - testpackage - - depguard - + enable-all: true + disable: + - errname + - execinquery # deprecated (since v1.58.0) + - exhaustruct + - exportloopref # deprecated (since v1.60.2) + - gomnd # deprecated (since v1.58.0) + - nilnil + - nlreturn + - paralleltest + - varnamelen + - wsl + fast: false -severity: +severity: default-severity: error rules: - linters: diff --git a/.prolayout.yml b/.prolayout.yml index af31249..491db75 100644 --- a/.prolayout.yml +++ b/.prolayout.yml @@ -1,6 +1,4 @@ +--- module: "github.com/wimspaargaren/prolayout" root: - name: "bar" - - -