Skip to content

Commit

Permalink
Update to tmpl-go template repository version 0.8.0 (#92)
Browse files Browse the repository at this point in the history
Updated to `tmpl-go` version `0.8.0` [1] which updated `golangci-lint`
to version `1.39.0` [2] and the `tmpl` repository version `0.9.0` [3].

[1]: https://github.com/svengreb/tmpl-go/releases/tag/v0.8.0
[2]: svengreb/tmpl-go#56
[3]: svengreb/tmpl-go#58

Closes GH-91
  • Loading branch information
svengreb authored Apr 27, 2021
1 parent f2b79bf commit 3e18917
Show file tree
Hide file tree
Showing 25 changed files with 133 additions and 2,755 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Copyright (c) 2019-present Sven Greb <[email protected]>
# This source code is licensed under the MIT license found in the LICENSE file.

# Configurations for EditorConfig.
# See https://editorconfig.org/#file-format-details for more details.

# +--------------------+
# + Base Configuration +
# +--------------------+
root = true

[*]
charset = utf-8
end_of_line = lf
Expand Down
7 changes: 4 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# This source code is licensed under the MIT license found in the LICENSE file.

# Configuration to define attributes per path.
# See the following references for more details:
# - https://git-scm.com/docs/gitattributes
# - https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Keyword-Expansion
#
# References:
# 1. https://git-scm.com/docs/gitattributes
# 2. https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Keyword-Expansion

# Automatically perform line feed (LF) normalization for files detected as text and
# leave all files detected as binary untouched.
Expand Down
5 changes: 3 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

# Configuration for the GitHub feature to automatically request reviews from the code owners
# when a pull request changes any owned files.
# See:
# 1. https://help.github.com/articles/about-codeowners
#
# References:
# 1. https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
# 2. https://github.com/blog/2392-introducing-code-owners

# +----------------------+
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!-- Click on the "Preview" tab to render the instructions in a more readable format -->

> **Please read the [contribution guidelines](https://github.com/svengreb/wand/blob/main/CONTRIBUTING.md) before filling out this issue template**.
> **Please read the [contribution guidelines](https://github.com/svengreb/wand/blob/main/CONTRIBUTING.md) before filling out this pull request template**.
## Prerequisites

This section and the instructions in the sections below are only part of this pull request template. Please ensure to **delete this whole section, all pre-filled instructions of the sections below and sections you have not filled out before submitting** to ensure a clear structure and overview.

Please do your best to provide as much information as possible and use a clear and descriptive title for your enhancement suggestion or bug fix to help maintainers and the community understand and reproduce the behavior, find related pull requests and to merge it faster.

- **Ensure the pull request has not already been submitted by using the [GitHub Issue search](https://github.com/svengreb/wand/issues)** — check if this enhancement or bug fix has already been suggested. If it has **and the pull request is still open**, add your additions as comment or [suggest a change](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request#applying-a-suggested-change) to the existing pull request instead of opening a new one. If you find a closed pull request that seems to be similar to this one, include a link to the original pull request in the [metadata head](#metadata-head) section of this new pull request.
- **Ensure the pull request has not already been submitted by using the [GitHub Pull Request search](https://github.com/svengreb/wand/pulls)** — check if this enhancement or bug fix has already been suggested. If it has **and the pull request is still open**, add your additions as comment or [suggest a change](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request#applying-a-suggested-change) to the existing pull request instead of opening a new one. If you find a closed pull request that seems to be similar to this one, include a link to the original pull request in the [metadata head](#metadata-head) section of this new pull request.
- **Ensure to adhere to the [pull request contribution guidelines](https://github.com/svengreb/wand/blob/main/CONTRIBUTING.md#pull-requests)**, especially the one for tests and documentations.
- **Check if the enhancement has already been implemented or bug already fixed** — use the [latest version](https://github.com/svengreb/wand/releases/latest) and [`main`](https://github.com/svengreb/wand/tree/main) branch to ensure that the enhancement or bug fix has not already been added.

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
echo "Workflow Actor: $GITHUB_ACTOR"
- name: Checkout repository
uses: actions/checkout@v2
- name: "Setup Node.js version 14.x"
- name: "Setup Node.js version 15"
uses: actions/[email protected]
with:
node-version: "14.x"
node-version: "15"
- name: Install Node modules
run: yarn --frozen-lockfile
- name: Run linters
Expand All @@ -51,7 +51,7 @@ jobs:
# See https://github.com/golangci/golangci-lint-action for more details.
uses: golangci/[email protected]
with:
version: v1.32
version: v1.39
test:
runs-on: ubuntu-latest
needs:
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2019-present Sven Greb <[email protected]>
# This source code is licensed under the MIT license found in the LICENSE file.

# Configuration to specify paths to ignore.
# Path match pattern to intentionally ignore untracked files and directories.
# See https://git-scm.com/docs/gitignore for more details.

# +--------------------+
Expand All @@ -17,9 +17,6 @@
# + Node.js +
# +---------+
**/node_modules/
yarn-debug.log*
yarn-error.log*
.yarn-integrity

# +-------------------+
# + Project Structure +
Expand Down
11 changes: 6 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ linters:
- dogsled
- dupl
- errcheck
- errorlint
- exhaustive
- exportloopref
- gochecknoinits
- goconst
- gocritic
Expand All @@ -50,13 +50,11 @@ linters:
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
- noctx
- nolintlint
- scopelint
- staticcheck
- structcheck
- stylecheck
Expand All @@ -67,7 +65,6 @@ linters:
- unused
- varcheck
- whitespace
- wrapcheck
# Run all linters, not only fast ones.
fast: false

Expand Down Expand Up @@ -133,6 +130,10 @@ linters-settings:
govet:
check-shadowing: true

importas:
execSupport: github.com/svengreb/wand/internal/support/exec
osSupport: github.com/svengreb/wand/internal/support/os

lll:
line-length: 160

Expand All @@ -148,4 +149,4 @@ run:
deadline: 15m

service:
golangci-lint-version: 1.32.x
golangci-lint-version: 1.39.x
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
14 changes: 14 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

# Copyright (c) 2019-present Sven Greb <[email protected]>
# This source code is licensed under the MIT license found in the LICENSE file.

# Git "pre-commit" hook for husky.
#
# References:
# 1. https://github.com/typicode/husky
# 2. https://git-scm.com/docs/githooks#_pre_commit

. "$(dirname "$0")/_/husky.sh"

npm exec lint-staged
15 changes: 0 additions & 15 deletions .huskyrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .mailmap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2019-present Sven Greb <[email protected]>
# This source code is licensed under the MIT license found in the LICENSE file.

# Configuration for Git mail mapping feature to coalesce together commits by the same person in the shortlog,
# Configuration for the Git mail mapping feature to coalesce together commits by the same person in the shortlog,
# where their name and/or email address was spelled differently or has been changed.
# See https://git-scm.com/docs/git-shortlog#_mapping_authors for more details.
Sven Greb <[email protected]>
19 changes: 19 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2020-present Sven Greb <[email protected]>
# This source code is licensed under the MIT license found in the LICENSE file.

# Configurations for npm.
# See https://docs.npmjs.com/cli/v7/configuring-npm/npmrc for more details.

# Only use a lockfile for single-consumer projects, like applications, but not for multi-consumer projects like
# libraries.
# It helps to pin dependency versions, improves the security through integrity checksums, prevents possible errors
# caused by updated transitive dependencies and allows to get deterministic build results, but it can hide problems in
# 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

# 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.
# This prevents possible errors caused by updated transitive dependencies.
save-exact=false
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2019-present Sven Greb <[email protected]>
# This source code is licensed under the MIT license found in the LICENSE file.

# Configuration to specify paths to ignore.
# Path match pattern to ignore (i.e. not reformat) certain files and folders.
# See https://prettier.io/docs/en/ignore for more details.

**/node_modules/*
2 changes: 1 addition & 1 deletion .remarkignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2019-present Sven Greb <[email protected]>
# This source code is licensed under the MIT license found in the LICENSE file.

# Configuration to specify paths to ignore.
# Path match pattern to ignore when searching for files.
# See https://github.com/unifiedjs/unified-engine/blob/HEAD/doc/ignore.md for more details.

# Important: Directories must have no "asterisk" wildcard character at the path end,
Expand Down
4 changes: 2 additions & 2 deletions .remarkrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*/

/**
* The configuration for remark-lint.
* Configurations for remark-lint.
*
* @see https://github.com/remarkjs/remark-lint
*/
module.exports = {
plugins: ["remark-preset-lint-arcticicestudio"],
plugins: ["@arcticicestudio/remark-preset-lint"],
};
8 changes: 0 additions & 8 deletions .yarnrc

This file was deleted.

17 changes: 7 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This release comes with support for Go 1.16 features like the new `install` comm
↠ As of Go version 1.16 [`go install $pkg@$version`][go-blog-1.16-modules] allows to install commands without affecting the `main` module. Additionally commands like `go build` and `go test` no longer modify `go.mod` and `go.sum` files by default but report an error if a module requirement or checksum needs to be added or updated (as if the `-mod=readonly` flag were used).
This can be used as alternative to the already existing [`gobin` runner][go-pkg-v0.4.1-pkg-task-gobin].

To support the [`go install` command of the Go toolchain][go-pkg-cmd#install], a new [`Task`][go-pkg-wand-pkg-task#task] has been implemented in the new [`install`][go-pkg-wand-pkg-task-golang-install] package that can be used through a [Go toolchain `Runner`][go-pkg-wand-pkg-task-golang#runner].
To support the [`go install` command of the Go toolchain][go-pkg-cmd/go#install], a new [`Task`][go-pkg-if-task#task] has been implemented in the new [`install`][go-pkg-wand-pkg-task-golang-install] package that can be used through a [Go toolchain `Runner`][go-pkg-wand-pkg-task-golang#runner].
The task is customizable through the following functions:

- `WithEnv(env map[string]string) install.Option` — sets the task specific environment.
Expand Down Expand Up @@ -405,7 +405,7 @@ The local installation of executables built from Go modules/packages has always
Unfortunately the way the [`go install` command][go-pkg-cmd/go#install] of Go versions less or equal to 1.15 handles the installation of an Go module/package executable is still not optimal.

The general problem of tool dependencies is a long-time known issue/weak point of the current Go toolchain and is a highly rated change request from the Go community with discussions like [golang/go#30515][gh-golang/go#30515], [golang/go#25922][gh-golang/go#25922] and [golang/go#27653][gh-golang/go#27653] to improve this essential feature, but they‘ve been around for quite a long time without a solution that works without introducing breaking changes and most users and the Go team agree on.
Luckily, this topic was finally picked up for [the next upcoming Go release version 1.16][gh-ms-golang/go#145] and [gh-golang/go#40276][] introduces a way to install executables in module mode outside a module. The [release note preview also already includes details about this change][go-docs-tip-rln-1.16#mod] and how installation of executables from Go modules will be handled in the future.
Luckily, this topic was finally picked up for [the next upcoming Go release version 1.16][gh-golang/go-ms-145] and [gh-golang/go#40276][] introduces a way to install executables in module mode outside a module. The [release note preview also already includes details about this change][go-docs-tip-rln-1.16#mod] and how installation of executables from Go modules will be handled in the future.

##### The Workaround

Expand Down Expand Up @@ -672,17 +672,20 @@ otherwise Markdown elements are not parsed and rendered!

<!--lint disable final-definition-->

<!-- Base Links -->
<!-- Base -->

<!-- Shared Links -->
<!-- Shared -->

[gh-golang/go-ms-145]: https://github.com/golang/go/milestone/145
[gh-markbates/pkger#114]: https://github.com/markbates/pkger/issues/114
[go-pkg-cmd/go#install]: https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies
[go-pkg-cmd/gofmt]: https://pkg.go.dev/cmd/gofmt
[go-pkg-const-task#kindgomodule]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task#KindGoModule
[go-pkg-elder]: https://pkg.go.dev/github.com/svengreb/wand/pkg/elder
[go-pkg-github.com/markbates/pkger]: https://pkg.go.dev/github.com/markbates/pkger
[go-pkg-if-task#gomodule]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task#GoModule
[go-pkg-if-task#runner]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task#Runner
[go-pkg-if-task#task]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task#Task
[go-pkg-stc-task/gobin#runner]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task/gobin#Runner
[go-ref-mod]: https://golang.org/ref/mod
[mage]: https://magefile.org
Expand All @@ -701,7 +704,6 @@ otherwise Markdown elements are not parsed and rendered!
[gh-golangci/golangci-lint-tree-cmd/golangci-lint]: https://github.com/golangci/golangci-lint/tree/master/cmd/golangci-lint
[gh-golangci/golangci-lint]: https://github.com/golangci/golangci-lint
[gh-mitchellh/gox]: https://github.com/mitchellh/gox
[gh-ms-golang/go#145]: https://github.com/golang/go/milestone/145
[gh-myitcv/gobin-wiki-faq]: https://github.com/myitcv/gobin/wiki/FAQ
[gh-myitcv/gobin]: https://github.com/myitcv/gobin
[gh-svengreb/tmpl-go-rl-v0.3.0]: https://github.com/svengreb/tmpl-go/releases/tag/v0.3.0
Expand All @@ -721,7 +723,6 @@ otherwise Markdown elements are not parsed and rendered!
[go-pkg-cmd/go#build]: https://pkg.go.dev/cmd/go/#hdr-Compile_packages_and_dependencies
[go-pkg-cmd/go#env_vars]: https://pkg.go.dev/cmd/go/#hdr-Environment_variables
[go-pkg-cmd/go#get]: https://pkg.go.dev/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them
[go-pkg-cmd/go#install]: https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies
[go-pkg-cmd/go#print_env]: https://pkg.go.dev/cmd/go/#hdr-Print_Go_environment_information
[go-pkg-cmd/go#test]: https://pkg.go.dev/cmd/go/#hdr-Test_packages
[go-pkg-const-spell#kindgomodule]: https://pkg.go.dev/github.com/svengreb/wand/pkg/spell#KindGoModule
Expand Down Expand Up @@ -771,15 +772,13 @@ otherwise Markdown elements are not parsed and rendered!
[go-pkg-if-task#exec]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task#Exec
[go-pkg-if-task#options]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task#Options
[go-pkg-if-task#runnerexec]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task#RunnerExec
[go-pkg-if-task#task]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task#Task
[mage-docs-targets]: https://magefile.org/targets
[wikip-cli#anaton]: https://en.wikipedia.org/wiki/Command-line_interface#Anatomy_of_a_shell_CLI
[wikip-exec]: https://en.wikipedia.org/wiki/Executable

<!-- v0.3.0 -->

[gh-compare-tag-v0.2.0_v0.3.0]: https://github.com/svengreb/wand/compare/v0.2.0...v0.3.0
[gh-golang/go-ms-145]: https://github.com/golang/go/milestone/145
[gh-golang/go#41191]: https://github.com/golang/go/issues/41191
[gh-imdario/mergo-comp-v0.3.9_v0.3.11]: https://github.com/imdario/mergo/compare/v0.3.9...v0.3.11
[gh-markbates/pkger#109]: https://github.com/markbates/pkger/issues/109
Expand Down Expand Up @@ -819,10 +818,8 @@ otherwise Markdown elements are not parsed and rendered!
[go-blog-1.16-modules]: https://blog.golang.org/go116-module-changes#TOC_4.
[go-blog-1.16]: https://blog.golang.org/go1.16
[go-docs-rln-1.16#embed]: https://golang.org/doc/go1.16#library-embed
[go-pkg-cmd#install]: https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies
[go-pkg-embed]: https://pkg.go.dev/embed
[go-pkg-v0.4.1-pkg-task-gobin]: https://pkg.go.dev/github.com/svengreb/[email protected]/pkg/task/gobin
[go-pkg-v0.4.1-pkg-task-pkger]: https://pkg.go.dev/github.com/svengreb/[email protected]/pkg/task/pkger
[go-pkg-wand-pkg-task-golang-install]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task/golang/install
[go-pkg-wand-pkg-task-golang#runner]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task/golang#Runner
[go-pkg-wand-pkg-task#task]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task#Task
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ When [reporting a bug](#bug-reports), sometimes even when [suggesting enhancemen
- …Complete – Provide all parts needed to reproduce the behavior
- …Verifiable – Test the code you're about to provide to make sure it reproduces the behavior

A MCVE is a common practice like on [Stack Overflow][stackoverflow-mcve] and sometimes it is also called [SSCCE][sscce], a _Short, Self Contained, Correct (Compilable), Example_.
A MCVE is a common practice like on [Stack Overflow][stackoverflow-mcve] and sometimes it is also called [SSCCE][], a _Short, Self Contained, Correct (Compilable), Example_.

The recommended way for GitHub based projects is to create it as [Gist][gh-gist] or new repository, but of course you can [attach it to issues and pull requests as files][ghd-attach-file], use any free code paste- or file hosting service or paste the code in [Markdown code blocks][ghd-markdown-code-blocks] into the issue.

Expand Down
6 changes: 3 additions & 3 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
*/

/**
* The configuration for lint-staged.
* Configurations for lint-staged.
*
* @see https://github.com/okonet/lint-staged#configuration
*/
module.exports = {
"*": "prettier --check",
"*.md": "remark --no-stdout",
"*.{css,html,js,json,yaml,yml}": "prettier --check",
"*.md": ["remark --no-stdout", "prettier --check"],
};
Loading

0 comments on commit 3e18917

Please sign in to comment.