diff --git a/.commitlintrc.yaml b/.commitlintrc.yaml new file mode 100644 index 0000000..985f3b9 --- /dev/null +++ b/.commitlintrc.yaml @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +extends: + - "@commitlint/config-conventional" diff --git a/.cruft.json b/.cruft.json new file mode 100644 index 0000000..fa0470c --- /dev/null +++ b/.cruft.json @@ -0,0 +1,17 @@ +{ + "template": "https://github.com/mrsimonemms/new", + "commit": "7b399837decdab782ba09613a447678ea1f17abb", + "checkout": null, + "context": { + "cookiecutter": { + "project_name": "devcontainers", + "description": "Prebuilt Dev Container images", + "author": "Simon Emms ", + "_template": "https://github.com/mrsimonemms/new" + } + }, + "directory": "blank", + "skip": [ + ".git" + ] +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index eae1e24..14d1595 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -16,5 +16,8 @@ } } }, + "postCreateCommand": { + "cookieninja-cruft": "pip install cruft" + }, "updateContentCommand": "npm install -g @devcontainers/cli" } diff --git a/.editorconfig b/.editorconfig index b1fb944..8b4a144 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + # editorconfig.org root = true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5195b6d..00bf3b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + name: Build on: push: diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index ad21cac..8df8e1d 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + name: Commit lint on: - pull_request diff --git a/.github/workflows/update-documentation.yml b/.github/workflows/update-documentation.yml index de3a00b..d929572 100644 --- a/.github/workflows/update-documentation.yml +++ b/.github/workflows/update-documentation.yml @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + name: "Update Documentation" on: push: diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 0000000..1e38a59 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,22 @@ +header: + license: + spdx-id: Apache-2.0 + copyright-owner: Simon Emms + paths-ignore: + - dist + - tmp + - LICENSE + - .* + - "go.*" + - "**/*.{json,md,yml,yaml}" + - gitconfig + comment: on-failure + language: + Go: + extensions: + - ".go" + comment_style_id: SlashAsterisk + +dependency: + files: + - go.mod # If this is a Go project. diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..9880c7a --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,12 @@ +{ + "MD007": { + "indent": 2 + }, + "MD013": { + "code_blocks": false, + "tables": false + }, + "MD032": false, + "MD033": false, + "default": true +} diff --git a/.mdlrc b/.mdlrc deleted file mode 100644 index ebf8e25..0000000 --- a/.mdlrc +++ /dev/null @@ -1 +0,0 @@ -style 'markdownlint.rb' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d6f859..6562eaa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + repos: + - repo: https://github.com/mrsimonemms/pre-commit-hooks + rev: v1.1.0 + hooks: + - id: license-eye - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: + - id: pretty-format-json + args: + - --autofix + - --no-sort-keys + - id: check-json - id: check-yaml + args: + - --allow-multiple-documents + - id: end-of-file-fixer + - id: trailing-whitespace - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/compilerla/conventional-pre-commit - rev: v2.1.1 + rev: v2.3.0 hooks: - id: conventional-pre-commit stages: @@ -15,7 +45,7 @@ repos: rev: v1.1.1 hooks: - id: markdown-toc - - repo: https://github.com/markdownlint/markdownlint - rev: v0.12.0 + - repo: https://github.com/DavidAnson/markdownlint-cli2 + rev: v0.8.1 hooks: - - id: markdownlint + - id: markdownlint-cli2 diff --git a/Makefile b/Makefile index 6c0b6a3..ff2d462 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,17 @@ +# Copyright 2023 Simon Emms +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + DOCKER_REPO ?= ghcr.io/mrsimonemms/devcontainers IMG_DIR = images PLATFORM ?= linux/amd64 @@ -37,3 +51,11 @@ install-devcontainers: npm i -g @devcontainers/cli; \ fi .PHONY: install-devcontainers + +cruft-update: +ifeq (,$(wildcard .cruft.json)) + @echo "Cruft not configured" +else + @cruft check || cruft update --skip-apply-ask --refresh-private-variables +endif +.PHONY: cruft-update diff --git a/README.md b/README.md index 23326ec..e2c77b1 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ Prebuilt Dev Container images * [Base](#base) * [Full](#full) * [Usage](#usage) +* [Contributing](#contributing) + * [Open in Gitpod](#open-in-gitpod) + * [Open in a container](#open-in-a-container) @@ -68,3 +71,13 @@ this would be by specifying the `image` in your `devcontainer.json` file: ``` As this image is pre-built, it will vastly speed up your workflow. + +## Contributing + +### Open in Gitpod + +* [Open in Gitpod](https://gitpod.io/from-referrer/) + +### Open in a container + +* [Open in a container](https://code.visualstudio.com/docs/devcontainers/containers) diff --git a/base/.devcontainer/Dockerfile b/base/.devcontainer/Dockerfile index 9e8eb3f..c28d1af 100644 --- a/base/.devcontainer/Dockerfile +++ b/base/.devcontainer/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2023 Simon Emms +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Based on the Gitpod base image # @link https://github.com/gitpod-io/workspace-images/blob/main/base/Dockerfile diff --git a/base/.devcontainer/bash_aliases b/base/.devcontainer/bash_aliases index c3b394b..778e395 100644 --- a/base/.devcontainer/bash_aliases +++ b/base/.devcontainer/bash_aliases @@ -1,4 +1,17 @@ -#!/bin/bash +# Copyright 2023 Simon Emms +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Collection of aliases # # This is run every time a new terminal window opens, so diff --git a/commitlint.config.js b/commitlint.config.js deleted file mode 100644 index 422b194..0000000 --- a/commitlint.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { extends: ['@commitlint/config-conventional'] }; diff --git a/features/cobra-cli/install.sh b/features/cobra-cli/install.sh index ce4491b..50b4196 100755 --- a/features/cobra-cli/install.sh +++ b/features/cobra-cli/install.sh @@ -1,4 +1,19 @@ #!/bin/bash +# Copyright 2023 Simon Emms +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + set -e TARGET_GOPATH="${TARGET_GOPATH:-"/go"}" diff --git a/markdownlint.rb b/markdownlint.rb deleted file mode 100644 index 413b00a..0000000 --- a/markdownlint.rb +++ /dev/null @@ -1,8 +0,0 @@ -all - -rule 'MD007', :indent => 2 -rule 'MD013', :ignore_code_blocks => true, :tables => false -exclude_rule 'MD002' -exclude_rule 'MD032' -exclude_rule 'MD033' -exclude_rule 'MD041'