Skip to content

Commit

Permalink
chore: connect to template repo with cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsimonemms committed Aug 21, 2023
1 parent 04d58fe commit 9b257c9
Show file tree
Hide file tree
Showing 18 changed files with 253 additions and 15 deletions.
19 changes: 19 additions & 0 deletions .commitlintrc.yaml
Original file line number Diff line number Diff line change
@@ -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"
17 changes: 17 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -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 <simon@simonemms.com>",
"_template": "https://github.com/mrsimonemms/new"
}
},
"directory": "blank",
"skip": [
".git"
]
}
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
}
}
},
"postCreateCommand": {
"cookieninja-cruft": "pip install cruft"
},
"updateContentCommand": "npm install -g @devcontainers/cli"
}
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/update-documentation.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
22 changes: 22 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
header:
license:
spdx-id: Apache-2.0
copyright-owner: Simon Emms <simon@simonemms.com>
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.
12 changes: 12 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"MD007": {
"indent": 2
},
"MD013": {
"code_blocks": false,
"tables": false
},
"MD032": false,
"MD033": false,
"default": true
}
1 change: 0 additions & 1 deletion .mdlrc

This file was deleted.

38 changes: 34 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 Simon Emms <simon@simonemms.com>
#
# 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
Expand Down Expand Up @@ -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
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- Regenerate with "pre-commit run -a markdown-toc" -->

Expand Down Expand Up @@ -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)
14 changes: 14 additions & 0 deletions base/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 Simon Emms <simon@simonemms.com>
#
# 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

Expand Down
15 changes: 14 additions & 1 deletion base/.devcontainer/bash_aliases
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
#!/bin/bash
# Copyright 2023 Simon Emms <simon@simonemms.com>
#
# 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
Expand Down
1 change: 0 additions & 1 deletion commitlint.config.js

This file was deleted.

15 changes: 15 additions & 0 deletions features/cobra-cli/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#!/bin/bash
# Copyright 2023 Simon Emms <simon@simonemms.com>
#
# 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"}"
Expand Down
8 changes: 0 additions & 8 deletions markdownlint.rb

This file was deleted.

0 comments on commit 9b257c9

Please sign in to comment.