Skip to content

Commit d198bd7

Browse files
authored
Initial commit
0 parents  commit d198bd7

40 files changed

+1193
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
end_of_line = lf
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.{md,yml,yaml}]
11+
indent_style = space
12+
indent_size = 2

.github/ISSUE_TEMPLATE/bug_report.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
**Describe the bug**
10+
11+
<!-- A clear and concise description of what the bug is. -->
12+
13+
**Steps to reproduce**
14+
15+
<!-- Steps to reproduce the behavior: -->
16+
17+
**Expected behavior**
18+
19+
<!-- A clear and concise description of what you expected to happen. -->
20+
21+
**Screenshots**
22+
23+
<!-- If applicable, add screenshots to help explain your problem. -->
24+
25+
**Additional context**
26+
27+
<!-- Add any other context about the problem here. -->
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ""
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
11+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
12+
13+
**Describe the solution you'd like**
14+
15+
<!-- A clear and concise description of what you want to happen. -->
16+
17+
**Describe alternatives you've considered**
18+
19+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
20+
21+
**Additional context**
22+
23+
<!-- Add any other context or screenshots about the feature request here. -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
3+
## Description
4+
5+
<!--- Describe your changes in detail -->
6+
7+
## Motivation and Context
8+
9+
<!--- Why is this change required? What problem does it solve? -->
10+
<!--- If it fixes an open issue, please link to the issue here. -->
11+
12+
## Types of changes
13+
14+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
15+
16+
- [ ] Bug fix (non-breaking change which fixes an issue)
17+
- [ ] New feature (non-breaking change which adds functionality)
18+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
19+
20+
## Usage examples
21+
22+
<!--- Provide examples of intended usage -->
23+
24+
## How Has This Been Tested?
25+
26+
<!--- Please describe in detail how you tested your changes. -->
27+
28+
## Checklist:
29+
30+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
31+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
32+
33+
- [ ] I have updated the documentation accordingly.
34+
- [ ] I have added tests to cover my changes.

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
# dependabot for GitHub Actions for this repo
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
# dependabot for GitHub Actions for the template
9+
- package-ecosystem: "github-actions"
10+
directory: "template/.github/"
11+
schedule:
12+
interval: "weekly"

.github/workflows/build.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
name: template setup test
12+
strategy:
13+
matrix:
14+
os:
15+
- ubuntu-latest
16+
- macos-latest
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
- name: Run Template Setup
22+
run: |
23+
git config user.name "Foo Bearer"
24+
./setup.bash \
25+
"asdf-foo" \
26+
"foo --help" \
27+
"asdf-community" \
28+
"ASDF Community" \
29+
"https://github.com/asdf-vm/asdf" \
30+
"https://asdf-vm.com" \
31+
"Apache-2.0" \
32+
"yes"
33+
34+
- name: Check setup result
35+
run: |
36+
set -xe
37+
ls -la .
38+
git log
39+
test ! -d template/
40+
grep "Apache" LICENSE
41+
test "main" = "$(git rev-parse --abbrev-ref HEAD)"
42+
! git grep -F -e "<YOUR TOOL>" \
43+
--or -e "<TOOL HOMEPAGE>" \
44+
--or -e "<TOOL REPO>" \
45+
--or -e "<TOOL CHECK>" \
46+
--or -e "<YOUR NAME>" \
47+
--or -e"<YOUR GITHUB USERNAME>"

.github/workflows/lint.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: asdf-vm/actions/install@v3
15+
- run: scripts/lint.bash
16+
17+
actionlint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Check workflow files
22+
uses: docker://rhysd/actionlint:1.6.23
23+
with:
24+
args: -color

.github/workflows/semantic-pr.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Lint
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
semantic-pr:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: amannn/[email protected]
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
with:
18+
validateSingleCommit: true

.tool-versions

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shellcheck 0.9.0
2+
shfmt 3.6.0

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 The asdf-vm core AUTHORS
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# asdf-plugin-template [![Build](https://github.com/asdf-vm/asdf-plugin-template/actions/workflows/build.yml/badge.svg)](https://github.com/asdf-vm/asdf-plugin-template/actions/workflows/build.yml) [![Lint](https://github.com/asdf-vm/asdf-plugin-template/actions/workflows/lint.yml/badge.svg)](https://github.com/asdf-vm/asdf-plugin-template/actions/workflows/lint.yml)
2+
3+
This is an [asdf-vm plugin](https://asdf-vm.com/#/plugins-create) template with CI to run [Shellcheck](https://github.com/koalaman/shellcheck) and testing with the [asdf test GitHub Action](https://github.com/asdf-vm/actions).
4+
5+
## Usage
6+
7+
1. [Generate](https://github.com/asdf-vm/asdf-plugin-template/generate) a new repository based on this template.
8+
1. Clone it and run `bash setup.bash`.
9+
1. Force push to your repo: `git push --force-with-lease`.
10+
1. Adapt your code at the TODO markers. To find the markers: `git grep TODO`.
11+
1. To develop your plugin further, please read [the plugins create section of the docs](https://asdf-vm.com/plugins/create.html).
12+
13+
>A feature of this plugin-template when hosted on GitHub is the use of [release-please](https://github.com/googleapis/release-please), an automated release tool. It leverages [Conventional Commit messages](https://www.conventionalcommits.org/) to determine semver release type, see the [documentation](https://github.com/googleapis/release-please).
14+
15+
## Contributing
16+
17+
Contributions welcome!
18+
19+
1. Install `asdf` tools
20+
21+
```shell
22+
asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git
23+
asdf plugin add shfmt https://github.com/luizm/asdf-shfmt.git
24+
asdf install
25+
```
26+
27+
1. Develop!
28+
29+
1. Lint & Format
30+
31+
```shell
32+
./scripts/format.bash
33+
./scripts/lint.bash
34+
```
35+
36+
1. PR changes

scripts/format.bash

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
# format this repo
4+
shfmt --language-dialect bash --write \
5+
setup.bash \
6+
scripts/*.bash
7+
8+
# format the template/
9+
shfmt --language-dialect bash --write \
10+
template/**/*

scripts/lint.bash

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
# lint this repo
4+
shellcheck --shell=bash --external-sources \
5+
setup.bash \
6+
scripts/*
7+
8+
shfmt --language-dialect bash --diff \
9+
setup.bash \
10+
scripts/*
11+
12+
# lint the template/
13+
shellcheck --shell=bash --external-sources \
14+
template/bin/* --source-path=template/lib/ \
15+
template/lib/* \
16+
template/scripts/*
17+
18+
shfmt --language-dialect bash --diff \
19+
template/**/*

0 commit comments

Comments
 (0)