Skip to content

Commit 672062a

Browse files
authored
Merge pull request #4 from sudo-bmitch/pr-contributing
Feat: Adding contributing prereqs
2 parents e71d906 + 73ea162 commit 672062a

File tree

13 files changed

+604
-0
lines changed

13 files changed

+604
-0
lines changed

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Feature request
3+
about: Request a new feature
4+
title: '[Feature] <title>'
5+
labels: enhancement
6+
7+
---
8+
9+
<!--
10+
Note: Please search to see if an issue already exists for the bug you encountered.
11+
-->
12+
13+
### Current Behavior
14+
15+
<!-- If applicable, what is currently happening. -->
16+
17+
### Expected Behavior
18+
19+
<!-- A concise description of what you expected to happen. -->
20+
21+
### Example Solution
22+
23+
<!--
24+
Example: steps to result in the desired behavior:
25+
1. In this environment...
26+
2. With this config...
27+
3. Run '...'
28+
4. Desired result...
29+
-->
30+
31+
### Anything else
32+
33+
<!--
34+
Links? References? Anything that will give us more context about the issue that you are encountering!
35+
-->

.github/ISSUE_TEMPLATE/issue.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Issue
3+
about: Report a bug or issue
4+
title: '[Issue] <title>'
5+
labels: bug
6+
7+
---
8+
9+
<!--
10+
Note: Please search to see if an issue already exists for the bug you encountered.
11+
-->
12+
13+
### Current Behavior
14+
15+
<!-- A concise description of what you're experiencing. -->
16+
17+
### Expected Behavior
18+
19+
<!-- A concise description of what you expected to happen. -->
20+
21+
### Steps To Reproduce
22+
23+
<!--
24+
Example: steps to reproduce the behavior:
25+
1. In this environment...
26+
2. With this config...
27+
3. Run '...'
28+
4. See error...
29+
-->
30+
31+
### Anything else
32+
33+
<!--
34+
Links? References? Anything that will give us more context about the issue that you are encountering!
35+
-->

.github/ISSUE_TEMPLATE/question.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Question
3+
about: Ask a question
4+
title: '[Question] <title>'
5+
labels: question
6+
7+
---
8+
9+
<!--
10+
Note: Please search to see if an issue already exists for the bug you encountered.
11+
-->
12+
13+
### Question
14+
15+
<!-- Ask away, but please include enough detail since we can't see your screen from here. -->
16+
17+
### Anything else
18+
19+
<!--
20+
Links? References? Anything that will give us more context about the issue that you are encountering!
21+
-->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!--
2+
3+
Commits must be signed indicating your agreement to the [DCO](https://developercertificate.org/).
4+
See [DCO missing](https://github.com/src-d/guide/blob/master/developer-community/fix-DCO.md) for steps to fix a missing signoff.
5+
6+
-->
7+
8+
### Fixes issue
9+
10+
<!-- If this is a bug fix, include "fixes #xxxx", or "closes #xxxx" -->
11+
12+
### Describe the change
13+
14+
<!-- Include the type of change: bug fix, new feature, breaking change, documentation update -->
15+
<!-- Describe what was changed, why the change was made, and how it was implemented -->
16+
17+
### How to verify it
18+
19+
<!-- Include steps that can be taken to verify the change -->
20+
21+
### Changelog text
22+
23+
<!-- If the release changelog should have an entry for this, include it here -->
24+
25+
### Please verify and check that the pull request fulfills the following requirements
26+
27+
<!-- Mark the following with an [X] to verify they are included -->
28+
29+
- [ ] Tests have been added or not applicable
30+
- [ ] Documentation has been added, updated, or not applicable
31+
- [ ] Changes have been rebased to main
32+
- [ ] Multiple commits to the same code have been squashed
33+
- [ ] All changes have been human generated or created with a reproducible tool
34+
35+
<!-- markdownlint-disable-file MD041 -->

.github/workflows/go.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ 'v*.*.*' ]
7+
pull_request:
8+
branches: [ '**' ]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
15+
build:
16+
name: Test and Lint
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
gover: ['go.mod', 'oldstable', 'stable']
21+
22+
env:
23+
# do not automatically upgrade go to a different version: https://go.dev/doc/toolchain
24+
GOTOOLCHAIN: "local"
25+
26+
steps:
27+
- name: Check out code
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
30+
- name: "Set up Go ${{ matrix.gover }}"
31+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
32+
with:
33+
go-version: ${{ matrix.go != 'go.mod' && matrix.go || null }}
34+
go-version-file: ${{ matrix.go == 'go.mod' && 'go.mod' || null }}
35+
check-latest: true
36+
id: go
37+
38+
- name: Verify go fmt
39+
run: test -z "$(go fmt ./...)"
40+
41+
- name: Verify go vet
42+
run: test -z "$(go vet ./...)"
43+
44+
- name: Test
45+
run: make test
46+
47+
- name: Linting
48+
if: matrix.gover == 'stable'
49+
run: make lint
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Version Check
2+
3+
on:
4+
schedule:
5+
- cron: '0 05 * * 0'
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
name: Version Check
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Check out code
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
- name: Version Check
20+
uses: docker://ghcr.io/sudo-bmitch/version-bump:edge
21+
with:
22+
args: check

.markdownlint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# all lists use a `-`
2+
MD004:
3+
style: dash
4+
5+
# allow tabs in code blocks (for Go)
6+
MD010:
7+
code_blocks: false
8+
9+
# disable line length, prefer one sentence per line for PRs
10+
MD013: false
11+
12+
# emphasis with underscore (`_emphasis_`)
13+
MD049:
14+
style: "underscore"
15+
16+
# bold with asterisk (`**bold**`)
17+
MD050:
18+
style: "asterisk"
19+

.version-bump.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{"name":"gha-uses-commit","key":"https://github.com/actions/checkout.git:v4.2.2","version":"11bd71901bbe5b1630ceea73d27597364c9af683"}
2+
{"name":"gha-uses-commit","key":"https://github.com/actions/setup-go.git:v5.5.0","version":"d35c59abb061a4a6fb18e82ac0862c26744d6ab5"}
3+
{"name":"gha-uses-semver","key":"https://github.com/actions/checkout.git","version":"v4.2.2"}
4+
{"name":"gha-uses-semver","key":"https://github.com/actions/setup-go.git","version":"v5.5.0"}
5+
{"name":"makefile-markdown-lint","key":"docker.io/davidanson/markdownlint-cli2","version":"v0.17.2"}
6+
{"name":"makefile-staticcheck","key":"https://github.com/dominikh/go-tools.git","version":"v0.6.1"}

.version-bump.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
files:
2+
".github/workflows/*.yml":
3+
processors:
4+
- gha-uses-vx
5+
- gha-uses-semver
6+
- gha-uses-commit
7+
"Makefile":
8+
processors:
9+
- makefile-markdown-lint
10+
- makefile-staticcheck
11+
12+
x-processor-tmpl:
13+
git-commit: &git-commit
14+
key: "{{ .SourceArgs.url }}:{{ .SourceArgs.ref }}"
15+
scan: "regexp"
16+
source: "git-commit"
17+
filter:
18+
expr: "^{{ .SourceArgs.ref }}$"
19+
git-tag-semver: &git-tag-semver
20+
key: "{{ .SourceArgs.url }}"
21+
scan: "regexp"
22+
source: "git-tag"
23+
filter:
24+
expr: '^v?\d+\.\d+\.\d+$'
25+
sort:
26+
method: "semver"
27+
registry-digest: &registry-digest
28+
key: "{{ .SourceArgs.image }}"
29+
scan: "regexp"
30+
source: "registry-digest"
31+
registry-tag-semver: &registry-tag-semver
32+
key: "{{ .SourceArgs.repo }}"
33+
scan: "regexp"
34+
source: "registry-tag"
35+
filter:
36+
expr: '^v?\d+\.\d+\.\d+$'
37+
sort:
38+
method: "semver"
39+
40+
processors:
41+
gha-uses-vx:
42+
<<: *git-tag-semver
43+
scanArgs:
44+
regexp: '^\s+-?\s+uses: (?P<Repo>[^@/]+/[^@/]+)[^@]*@(?P<Commit>[0-9a-f]+)\s+#\s+(?P<Version>v?\d+)\s*$'
45+
sourceArgs:
46+
url: "https://github.com/{{ .ScanMatch.Repo }}.git"
47+
filter:
48+
expr: '^v?\d+$'
49+
gha-uses-semver:
50+
<<: *git-tag-semver
51+
scanArgs:
52+
regexp: '^\s+-?\s+uses: (?P<Repo>[^@/]+/[^@/]+)[^@]*@(?P<Commit>[0-9a-f]+)\s+#\s+(?P<Version>v?\d+\.\d+\.\d+)\s*$'
53+
sourceArgs:
54+
url: "https://github.com/{{ .ScanMatch.Repo }}.git"
55+
gha-uses-commit:
56+
<<: *git-commit
57+
scanArgs:
58+
regexp: '^\s+-?\s+uses: (?P<Repo>[^@/]+/[^@/]+)[^@]*@(?P<Version>[0-9a-f]+)\s+#\s+(?P<Ref>[\w\d\.]+)\s*$'
59+
sourceArgs:
60+
url: "https://github.com/{{ .ScanMatch.Repo }}.git"
61+
ref: "{{ .ScanMatch.Ref }}"
62+
63+
makefile-markdown-lint:
64+
<<: *registry-tag-semver
65+
scanArgs:
66+
regexp: '^MARKDOWN_LINT_VER\?=(?P<Version>v?[0-9\.]+)\s*$'
67+
sourceArgs:
68+
repo: "docker.io/davidanson/markdownlint-cli2"
69+
makefile-staticcheck:
70+
<<: *git-tag-semver
71+
scanArgs:
72+
regexp: '^STATICCHECK_VER\?=(?P<Version>v?[0-9\.]+)\s*$'
73+
sourceArgs:
74+
url: "https://github.com/dominikh/go-tools.git"
75+
filter:
76+
# repo also has dated tags, ignore versions without a preceding "v"
77+
expr: '^v\d+\.\d+\.\d+$'
78+
79+
scans:
80+
regexp:
81+
type: "regexp"
82+
83+
sources:
84+
git-commit:
85+
type: "git"
86+
args:
87+
type: "commit"
88+
git-tag:
89+
type: "git"
90+
args:
91+
type: "tag"
92+
registry-digest:
93+
type: "registry"
94+
registry-tag:
95+
type: "registry"
96+
args:
97+
type: "tag"

0 commit comments

Comments
 (0)