Skip to content

Commit

Permalink
Update to tmpl-go template repository version 0.9.0
Browse files Browse the repository at this point in the history
Updated to `tmpl-go` version `0.9.0` [1] which...

1. updated to `golangci-lint` version `1.43.0` [2] - new linters are
   introduced and configurations of already supported ones are improved
   or added.
2. updated the Go module to Go `1.17` [3].
3. optimized the GitHub action workflows for Go and Node [4] - the `ci`
   workflow has been optimized by splitting it into new `ci-go` and
   `ci-node` workflows.
4. updated to the `tmpl` template repository version `0.10.0` [5].

See the full `tmpl-go` version `0.9.0` changelog [1] for all details.

[1]: https://github.com/svengreb/tmpl-go/releases/tag/v0.9.0
[2]: svengreb/tmpl-go#64
[3]: svengreb/tmpl-go#66
[4]: svengreb/tmpl-go#68
[5]: svengreb/tmpl-go#70

GH-104
  • Loading branch information
svengreb committed Nov 20, 2021
1 parent b8b906c commit 7a44101
Show file tree
Hide file tree
Showing 31 changed files with 10,313 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-present Sven Greb <development@svengreb.de>
# Copyright (c) 2019-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the LICENSE file.

# Configuration for the native Dependabot integration.
Expand Down
46 changes: 18 additions & 28 deletions .github/workflows/ci.yml → .github/workflows/ci-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
# GitHub Action Workflow for continuous integration jobs.
# See https://docs.github.com/en/actions and https://github.com/features/actions for more details.

name: ci
name: ci-go
on:
push:
paths:
- "**.go"
branches:
- main
tags:
- v*
pull_request:
paths:
- "**.go"

jobs:
lint-node:
lint:
runs-on: ubuntu-latest
steps:
- name: Print metadata and context information
Expand All @@ -24,38 +28,20 @@ jobs:
echo "Workflow Actor: $GITHUB_ACTOR"
- name: Checkout repository
uses: actions/checkout@v2
- name: "Setup Node.js version 15"
uses: actions/setup-node@v2.4.1
with:
node-version: "15"
- name: Install Node modules
run: yarn --frozen-lockfile
- name: Run linters
run: yarn lint
lint-go:
runs-on: ubuntu-latest
steps:
- name: Print metadata and context information
run: |
echo "Git SHA: $GITHUB_SHA"
echo "Git Ref: $GITHUB_REF"
echo "Workflow Actor: $GITHUB_ACTOR"
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Go
- name: Install Go 1.17
uses: actions/setup-go@v2
with:
go-version: "1.16.x"
go-version: "1.17.x"
- name: "Run golangci-lint"
# The official golangci-lint action created and maintained by the golangci-lint project.
# See https://github.com/golangci/golangci-lint-action for more details.
uses: golangci/golangci-lint-action@v2.5.2
with:
version: v1.39
version: v1.43
test:
runs-on: ubuntu-latest
needs:
- lint-go
- lint
steps:
- name: Print metadata and context information
run: |
Expand All @@ -64,9 +50,13 @@ jobs:
echo "Workflow Actor: $GITHUB_ACTOR"
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Go
- name: Install Go 1.17
uses: actions/setup-go@v2
with:
go-version: "1.16.x"
- name: "Run tests with coverage and race detector"
run: go test -cover -race -v ./...
go-version: "1.17.x"
- name: Bootstrap tools
run: go run make.go bootstrap
- name: Run unit tests with coverage and race detector
run: go run make.go testCover testRace
- name: Run integration tests
run: go run make.go testIntegration
47 changes: 47 additions & 0 deletions .github/workflows/ci-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (c) 2019-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the LICENSE file.

# GitHub Action Workflow for continuous integration jobs.
# See https://docs.github.com/en/actions and https://github.com/features/actions for more details.

name: ci-node
on:
push:
paths:
- "**.js"
- "**.json"
- "**.md"
- "**.yaml"
- "**.yml"
branches:
- main
tags:
- v*
pull_request:
paths:
- "**.js"
- "**.json"
- "**.md"
- "**.yaml"
- "**.yml"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Print metadata and context information
run: |
echo "Git SHA: $GITHUB_SHA"
echo "Git Ref: $GITHUB_REF"
echo "Workflow Actor: $GITHUB_ACTOR"
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js version 16
uses: actions/setup-node@v2.4.1
with:
node-version: "16"
cache: "npm"
- name: Install Node modules
run: npm ci
- name: Run linters in CI/CD mode
run: npm run lint:ci
85 changes: 80 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ issues:
linters:
disable-all: true
enable:
- bidichk
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- errorlint
- exhaustive
- exportloopref
- gochecknoinits
Expand All @@ -42,7 +44,6 @@ linters:
- gofumpt
- goheader
- goimports
- golint
- gomnd
- gomodguard
- goprintffuncname
Expand All @@ -53,18 +54,22 @@ linters:
- lll
- misspell
- nakedret
- nilnil
- noctx
- nolintlint
- revive
- staticcheck
- structcheck
- stylecheck
- tenv
- tparallel
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
- wrapcheck
# Run all linters, not only fast ones.
fast: false

Expand All @@ -89,6 +94,12 @@ linters-settings:
# Example: `a := b.(CustomStruct)`
check-type-assertions: true

errorlint:
# Prevent false-positive matches for code lines that explicitly do not wrap the error to prevent it become part of
# the public API.
# See https://github.com/svengreb/tmpl-go/issues/39 and https://github.com/svengreb/tmpl-go/issues/64 for details.
errorf: false

gci:
# A comma-separated list of prefixes for local package imports to be put after 3rd-party packages.
local-prefixes: github.com/svengreb/wand
Expand All @@ -105,6 +116,7 @@ linters-settings:

gofumpt:
extra-rules: true
lang-version: "1.17"

goheader:
values:
Expand All @@ -121,9 +133,6 @@ linters-settings:
# A comma-separated list of prefixes for local package imports to be put after 3rd-party packages.
local-prefixes: github.com/svengreb/wand

golint:
min-confidence: 0.0

gomnd:
settings:
mnd:
Expand All @@ -140,6 +149,7 @@ linters-settings:

lll:
line-length: 160
tab-width: 2

misspell:
locale: US
Expand All @@ -148,9 +158,74 @@ linters-settings:
- magefile
- nib

# See https://github.com/mgechev/revive#available-rules and
# https://github.com/mgechev/revive#recommended-configuration for more details.
revive:
ignore-generated-header: false
severity: warning
error-code: 1
# Ignore linting errors with less than 0.2 confidence.
confidence: 0.2
rules:
- name: atomic
- name: context-as-argument
- name: deep-exit
- name: defer
- name: duplicated-imports
severity: error
- name: early-return
- name: empty-block
- name: empty-lines
- name: error-naming
- name: error-return
severity: error
- name: error-strings
- name: errorf
- name: exported
arguments:
- checkPrivateReceivers
- disableStutteringCheck
- name: identical-branches
- name: if-return
- name: import-shadowing
severity: error
- name: increment-decrement
- name: indent-error-flow
- name: package-comments
- name: range
- name: receiver-naming
- name: redefines-builtin-id
severity: error
- name: string-of-int
severity: error
- name: superfluous-else
- name: time-equal
- name: time-naming
- name: unconditional-recursion
- name: unexported-naming
- name: unexported-return
- name: unhandled-error
- name: unreachable-code
- name: useless-break
- name: var-declaration

tagliatelle:
case:
use-field-name: true
rules:
bson: goCamel
json: goCamel
mapstructure: snake
xml: goCamel
yaml: goCamel

wrapcheck:
ignorePackageGlobs:
- github.com/svengreb/wand/*

# Options for analysis runs.
run:
deadline: 15m

service:
golangci-lint-version: 1.39.x
golangci-lint-version: 1.43.x
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-present Sven Greb <development@svengreb.de>
# Copyright (c) 2019-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the LICENSE file.

# Configurations for npm.
Expand All @@ -11,7 +11,7 @@
# multi-consumer projects when any later versions of a used dependency, or its transitive dependencies, is not
# compatible with the own project anymore.
# See https://github.com/svengreb/tmpl/issues/70 for more details.
package-lock=false
package-lock=true

# Resolve to the latest minor and patch updates.
# Enable to automatically pin dependencies to exact versions instead of resolving to latest minor and patch updates.
Expand Down
6 changes: 0 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,10 @@ A style guide establishes and enforces style to improve the intelligibility and

wand adheres to the [Arctic Ice Studio JavaScript Style Guide][gh-styleguide-javascript].

[![][gh-styleguide-javascript-badge]][gh-styleguide-javascript]

### Markdown Style Guide

wand adheres to the [Arctic Ice Studio Markdown Style Guide][gh-styleguide-markdown].

[![][gh-styleguide-markdown-badge]][gh-styleguide-markdown]

### Git Commit Messages

A well-crafted Git commit message is the best way to communicate _context_ about a change to the maintainers. The code will tell what changed, but only the commit message can properly tell why. Re-establishing the context of a piece of code is wasteful. We can't avoid it completely, so our efforts should go to reducing it as much as possible.
Expand Down Expand Up @@ -197,9 +193,7 @@ Thanks for the inspirations and attributions to GitHub's [Open Source Guides][os
[gh-releases-latest]: https://github.com/svengreb/wand/releases/latest
[gh-styleguide-git-badge]: https://raw.githubusercontent.com/arcticicestudio/styleguide-git/develop/assets/styleguide-git-banner-typography-badge.svg?sanitize=true
[gh-styleguide-git]: https://github.com/arcticicestudio/styleguide-git
[gh-styleguide-javascript-badge]: https://raw.githubusercontent.com/arcticicestudio/styleguide-javascript/develop/assets/styleguide-javascript-banner-typography-badge.svg?sanitize=true
[gh-styleguide-javascript]: https://github.com/arcticicestudio/styleguide-javascript
[gh-styleguide-markdown-badge]: https://raw.githubusercontent.com/arcticicestudio/styleguide-markdown/develop/assets/styleguide-markdown-banner-typography-badge.svg?sanitize=true
[gh-styleguide-markdown]: https://github.com/arcticicestudio/styleguide-markdown
[ghd-attach-file]: https://docs.github.com/en/github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests
[ghd-issue-keywords]: https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<p align="center"><a href="https://github.com/svengreb/wand/releases/latest"><img src="https://img.shields.io/github/release/svengreb/wand.svg?style=flat-square&label=Release&logo=github&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/></a> <a href="https://github.com/svengreb/wand/blob/main/CHANGELOG.md"><img src="https://img.shields.io/github/release/svengreb/wand.svg?style=flat-square&label=Changelog&logo=github&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/></a> <a href="https://pkg.go.dev/github.com/svengreb/wand"><img src="https://img.shields.io/github/release/svengreb/wand.svg?style=flat-square&label=GoDoc&logo=github&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/></a></p>

<p align="center"><a href="https://github.com/svengreb/wand/actions?query=workflow%3Aci" target="_blank"><img src="https://img.shields.io/github/workflow/status/svengreb/wand/ci.svg?style=flat-square&label=CI&logo=github&logoColor=eceff4&colorA=4c566a"/></a> <a href="https://codecov.io/gh/svengreb/wand" target="_blank"><img src="https://img.shields.io/codecov/c/github/svengreb/wand/main.svg?style=flat-square&label=Coverage&logo=codecov&logoColor=eceff4&colorA=4c566a"/></a></p>
<p align="center"><a href="https://github.com/svengreb/wand/actions?query=workflow%3Aci-go" target="_blank"><img src="https://img.shields.io/github/workflow/status/svengreb/wand/ci-go.svg?style=flat-square&label=CI%20Go&logo=github&logoColor=eceff4&colorA=4c566a"/></a> <a href="https://github.com/svengreb/wand/actions?query=workflow%3Aci-node" target="_blank"><img src="https://img.shields.io/github/workflow/status/svengreb/wand/ci-node.svg?style=flat-square&label=CI%20Node&logo=github&logoColor=eceff4&colorA=4c566a"/></a> <a href="https://codecov.io/gh/svengreb/wand" target="_blank"><img src="https://img.shields.io/codecov/c/github/svengreb/wand/main.svg?style=flat-square&label=Coverage&logo=codecov&logoColor=eceff4&colorA=4c566a"/></a></p>

<p align="center"><a href="https://golang.org/doc/effective_go.html#formatting" target="_blank"><img src="https://img.shields.io/static/v1?style=flat-square&label=Go%20Style%20Guide&message=gofmt&logo=go&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/></a> <a href="https://github.com/arcticicestudio/styleguide-markdown/releases/latest" target="_blank"><img src="https://img.shields.io/github/release/arcticicestudio/styleguide-markdown.svg?style=flat-square&label=Markdown%20Style%20Guide&logoColor=eceff4&colorA=4c566a&colorB=88c0d0&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzOSIgaGVpZ2h0PSIzOSIgdmlld0JveD0iMCAwIDM5IDM5Ij48cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNEOERFRTkiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMS41IDEuNWgzNnYzNmgtMzZ6Ii8%2BPHBhdGggZmlsbD0iI0Q4REVFOSIgZD0iTTIwLjY4MyAyNS42NTVsNS44NzItMTMuNDhoLjU2Nmw1Ljg3MyAxMy40OGgtMS45OTZsLTQuMTU5LTEwLjA1Ni00LjE2MSAxMC4wNTZoLTEuOTk1em0tMi42OTYgMGwtMTMuNDgtNS44NzJ2LS41NjZsMTMuNDgtNS44NzJ2MS45OTVMNy45MzEgMTkuNWwxMC4wNTYgNC4xNnoiLz48L3N2Zz4%3D"/></a> <a href="https://github.com/arcticicestudio/styleguide-git/releases/latest" target="_blank"><img src="https://img.shields.io/github/release/arcticicestudio/styleguide-git.svg?style=flat-square&label=Git%20Style%20Guide&logoColor=eceff4&colorA=4c566a&colorB=88c0d0&logo=git"/></a></p>

Expand Down
4 changes: 4 additions & 0 deletions examples/custom_runner/runners.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2019-present Sven Greb <development@svengreb.de>
// This source code is licensed under the MIT license found in the LICENSE file.

//go:build mage
// +build mage

package main
Expand Down
4 changes: 4 additions & 0 deletions examples/custom_task/tasks.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2019-present Sven Greb <development@svengreb.de>
// This source code is licensed under the MIT license found in the LICENSE file.

//go:build mage
// +build mage

package main
Expand Down
3 changes: 3 additions & 0 deletions examples/monorepo/apps/cli/cli.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Sven Greb <development@svengreb.de>
// This source code is licensed under the MIT license found in the LICENSE file.

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions examples/monorepo/apps/daemon/daemon.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Sven Greb <development@svengreb.de>
// This source code is licensed under the MIT license found in the LICENSE file.

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions examples/monorepo/apps/promexp/promexp.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Sven Greb <development@svengreb.de>
// This source code is licensed under the MIT license found in the LICENSE file.

package main

import (
Expand Down
4 changes: 4 additions & 0 deletions examples/monorepo/magefile.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2019-present Sven Greb <development@svengreb.de>
// This source code is licensed under the MIT license found in the LICENSE file.

//go:build mage
// +build mage

package main
Expand Down
Loading

0 comments on commit 7a44101

Please sign in to comment.