Skip to content

Commit 82d42b1

Browse files
authored
Merge pull request #1090 from sudo-bmitch/pr-markdown-lint
Add a markdown linter
2 parents b74f378 + a6af2b4 commit 82d42b1

20 files changed

+436
-395
lines changed

.github/PULL_REQUEST_TEMPLATE/maintainer_nomination.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ Name of the new maintainer with GitHub username
1111
## Justification
1212

1313
Highlight any work contributed by the new maintainer. Examples of contributions may be:
14+
1415
- Community involvement in mailing lists and meetings
1516
- Involvement in any OCI working groups
1617
- Contributions to any of the OCI git repositories
1718

1819
Other considerations may be:
20+
1921
- Diversity of organizations
2022
- Time involved in the community
2123
- Personal experience working with the new maintainer

.markdownlint.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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"

EMERITUS.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
# Emeritus
2+
13
We would like to acknowledge previous OCI image spec maintainers and their huge contributions to our collective success:
24

3-
* Brandon Philips (@philips)
4-
* Brendan Burns (@brendandburns)
5-
* Jason Bouzane (@jbouzane)
6-
* John Starks (@jstarks)
7-
* Keyang Xie (@xiekeyang)
5+
- Brandon Philips (@philips)
6+
- Brendan Burns (@brendandburns)
7+
- Jason Bouzane (@jbouzane)
8+
- John Starks (@jstarks)
9+
- Keyang Xie (@xiekeyang)
810

911
We thank these members for their service to the OCI community.

HACKING.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ This spec includes several Go packages, and a command line tool considered to be
1010

1111
Prerequisites:
1212

13-
* Go - current release only, earlier releases are not supported
14-
* make
13+
- Go - current release only, earlier releases are not supported
14+
- make
1515

1616
The following make targets are relevant for any work involving the Go packages.
1717

@@ -43,7 +43,7 @@ This target auto-formats all JSON files in the `schema` directory using the `jq`
4343

4444
Prerequisites:
4545

46-
* [jq][jq] >=1.5
46+
- [jq][jq] >=1.5
4747

4848
Invocation:
4949

@@ -57,7 +57,7 @@ This target generates a PDF/HTML version of the OCI image specification.
5757

5858
Prerequisites:
5959

60-
* [Docker][docker]
60+
- [Docker][docker]
6161

6262
Invocation:
6363

@@ -91,7 +91,7 @@ This target generates PNG image files from DOT source files in the `img` directo
9191

9292
Prerequisites:
9393

94-
* [graphviz][graphviz]
94+
- [graphviz][graphviz]
9595

9696
Invocation:
9797

Makefile

+14-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ DOC_FILES := \
4141
FIGURE_FILES := \
4242
img/media-types.png
4343

44+
MARKDOWN_LINT_VER?=v0.8.1
45+
4446
TOOLS := gitvalidation
4547

4648
default: check-license lint test
@@ -81,10 +83,20 @@ check-license: ## check license headers in source files
8183
@./.tool/check-license
8284

8385
.PHONY: lint
84-
lint: .install.lint ## lint check of Go files using golangci-lint
85-
@echo "checking lint"
86+
87+
.PHONY: lint
88+
lint: lint-go lint-md ## Run all linters
89+
90+
.PHONY: lint-go
91+
lint-go: .install.lint ## lint check of Go files using golangci-lint
92+
@echo "checking Go lint"
8693
@GO111MODULE=on $(GOPATH)/bin/golangci-lint run
8794

95+
.PHONY: lint-md
96+
lint-md: ## Run linting for markdown
97+
docker run --rm -v "$(PWD):/workdir:ro" docker.io/davidanson/markdownlint-cli2:$(MARKDOWN_LINT_VER) \
98+
**/*.md "#vendor"
99+
88100
.PHONY: test
89101
test: ## run the unit tests
90102
go test -race -cover $(shell go list ./... | grep -v /vendor/)

README.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# OCI Image Format Specification
2-
<div>
3-
<a href="https://travis-ci.org/opencontainers/image-spec">
4-
<img src="https://travis-ci.org/opencontainers/image-spec.svg?branch=master"></img>
5-
</a>
6-
</div>
2+
3+
![GitHub Actions for Docs and Linting](https://img.shields.io/github/actions/workflow/status/opencontainers/image-spec/docs-and-linting.yml?branch=main&label=GHA%20docs%20and%20linting)
4+
![License](https://img.shields.io/github/license/opencontainers/image-spec)
5+
[![Go Reference](https://pkg.go.dev/badge/github.com/opencontainers/image-spec.svg)](https://pkg.go.dev/github.com/opencontainers/image-spec)
76

87
The OCI Image Format project creates and maintains the software shipping container image format spec (OCI Image Format).
98

@@ -28,8 +27,8 @@ At this point the OCI Runtime Bundle would be run by an OCI Runtime.
2827

2928
This entire workflow supports the UX that users have come to expect from container engines like Docker and rkt: primarily, the ability to run an image with no additional arguments:
3029

31-
* docker run example.com/org/app:v1.0.0
32-
* rkt run example.com/org/app,version=v1.0.0
30+
- docker run example.com/org/app:v1.0.0
31+
- rkt run example.com/org/app,version=v1.0.0
3332

3433
To support this UX the OCI Image Format contains sufficient information to launch the application on the target platform (e.g. command, arguments, environment variables, etc).
3534

@@ -51,14 +50,14 @@ Find more [FAQ on the OCI site](https://www.opencontainers.org/faq).
5150

5251
The [GitHub milestones](https://github.com/opencontainers/image-spec/milestones) lay out the path to the future improvements.
5352

54-
# Contributing
53+
## Contributing
5554

5655
Development happens on GitHub for the spec.
5756
Issues are used for bugs and actionable items and longer discussions can happen on the [mailing list](#mailing-list).
5857

5958
The specification and code is licensed under the Apache 2.0 license found in the `LICENSE` file of this repository.
6059

61-
## Discuss your design
60+
### Discuss your design
6261

6362
The project welcomes submissions, but please let everyone know what you are working on.
6463

@@ -69,33 +68,33 @@ It also guarantees that the design is sound before code is written; a GitHub pul
6968
Typos and grammatical errors can go straight to a pull-request.
7069
When in doubt, start on the [mailing-list](#mailing-list).
7170

72-
## Meetings
71+
### Meetings
7372

74-
Please see the [OCI org repository README](https://github.com/opencontainers/org#meetings) for the most up-to-date information on OCI contributor and maintainer meeting schedules.
73+
Please see the [OCI org repository README](https://github.com/opencontainers/org#meetings) for the most up-to-date information on OCI contributor and maintainer meeting schedules.
7574
You can also find links to meeting agendas and minutes for all prior meetings.
7675

77-
## Mailing List
76+
### Mailing List
7877

7978
You can subscribe and join the mailing list on [Google Groups](https://groups.google.com/a/opencontainers.org/forum/#!forum/dev).
8079

81-
## IRC
80+
### IRC
8281

8382
OCI discussion happens on #opencontainers on Freenode ([logs][irc-logs]).
8483

85-
## Markdown style
84+
### Markdown style
8685

8786
To keep consistency throughout the Markdown files in the Open Container spec all files should be formatted one sentence per line.
8887
This fixes two things: it makes diffing easier with git and it resolves fights about line wrapping length.
8988
For example, this paragraph will span three lines in the Markdown source.
9089

91-
## Git commit
90+
### Git commit
9291

93-
### Sign your work
92+
#### Sign your work
9493

9594
The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch.
9695
The rules are pretty simple: if you can certify the below (from [developercertificate.org](https://developercertificate.org/)):
9796

98-
```
97+
```text
9998
Developer Certificate of Origin
10099
Version 1.1
101100
@@ -136,7 +135,9 @@ By making a contribution to this project, I certify that:
136135

137136
then you just add a line to every git commit message:
138137

139-
Signed-off-by: Joe Smith <[email protected]>
138+
```text
139+
Signed-off-by: Joe Smith <[email protected]>
140+
```
140141

141142
using your real name (sorry, no pseudonyms or anonymous contributions.)
142143

@@ -154,9 +155,8 @@ Read more on [How to Write a Git Commit Message](https://chris.beams.io/posts/gi
154155
5. Use the imperative mood in the subject line
155156
6. Wrap the body at 72 characters
156157
7. Use the body to explain what and why vs. how
157-
* If there was important/useful/essential conversation or information, copy or include a reference
158+
- If there was important/useful/essential conversation or information, copy or include a reference
158159
8. When possible, one keyword to scope the change in the subject (i.e. "README: ...", "runtime: ...")
159160

160-
161161
[code-of-conduct]: https://github.com/opencontainers/org/blob/master/CODE_OF_CONDUCT.md
162162
[irc-logs]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/

RELEASES.md

+39-37
Original file line numberDiff line numberDiff line change
@@ -20,59 +20,60 @@ They may not propose a v1.0.0-rc3 until the v1.0.0-rc2 is accepted (on the 7th i
2020
The OCI maintains three categories of projects: specifications, applications, and conformance-testing tools.
2121
However, specification releases have special restrictions in the [OCI charter][charter]:
2222

23-
* They are the target of backwards compatibility (§7.g), and
24-
* They are subject to the OFWa patent grant (§8.d and e).
23+
- They are the target of backwards compatibility (§7.g), and
24+
- They are subject to the OFWa patent grant (§8.d and e).
2525

2626
To avoid unfortunate side effects (onerous backwards compatibility requirements or Member resignations), the following additional procedures apply to specification releases:
2727

2828
### Planning a release
2929

3030
Every OCI specification project SHOULD hold meetings that involve maintainers reviewing pull requests, debating outstanding issues, and planning releases.
3131
This meeting MUST be advertised on the project README and MAY happen on a phone call, video conference, or on IRC.
32-
Maintainers MUST send updates to the [email protected] with results of these meetings.
32+
Maintainers MUST send updates to the <[email protected]> with results of these meetings.
3333

3434
Before the specification reaches v1.0.0, the meetings SHOULD be weekly.
3535
Once a specification has reached v1.0.0, the maintainers may alter the cadence, but a meeting MUST be held within four weeks of the previous meeting.
3636

37-
The release plans, corresponding milestones and estimated due dates MUST be published on GitHub (e.g. https://github.com/opencontainers/runtime-spec/milestones).
37+
The release plans, corresponding milestones and estimated due dates MUST be published on GitHub (e.g. <https://github.com/opencontainers/runtime-spec/milestones>).
3838
GitHub milestones and issues are only used for community organization and all releases MUST follow the [project governance](GOVERNANCE.md) rules and procedures.
3939

4040
### Timelines
4141

4242
Specifications have a variety of different timelines in their lifecycle.
4343

44-
* Pre-v1.0.0 specifications SHOULD release on a monthly cadence to garner feedback.
45-
* Major specification releases MUST release at least three release candidates spaced a minimum of one week apart.
44+
- Pre-v1.0.0 specifications SHOULD release on a monthly cadence to garner feedback.
45+
- Major specification releases MUST release at least three release candidates spaced a minimum of one week apart.
4646
This means a major release like a v1.0.0 or v2.0.0 release will take 1 month at minimum: one week for rc1, one week for rc2, one week for rc3, and one week for the major release itself.
4747
Maintainers SHOULD strive to make zero breaking changes during this cycle of release candidates and SHOULD restart the three-candidate count when a breaking change is introduced.
4848
For example if a breaking change is introduced in v1.0.0-rc2 then the series would end with v1.0.0-rc4 and v1.0.0.
49-
* Minor and patch releases SHOULD be made on an as-needed basis.
49+
- Minor and patch releases SHOULD be made on an as-needed basis.
5050

5151
[charter]: https://github.com/opencontainers/tob/blob/main/CHARTER.md
5252

5353
## Checklist
5454

5555
Releases usually follow a few steps:
5656

57-
* [ ] prepare a pull-request for the release
58-
* [ ] a commit updating `./ChangeLog`
59-
* [ ] `git log --oneline --no-merges --decorate --name-status v1.0.1..HEAD | vim -`
60-
* [ ] `:% s/(pr\/\(\d*\))\(.*\)/\2 (#\1)/` to move the PR to the end of line and match previous formatting
61-
* [ ] review `(^M|^A|^D)` for impact of the commit
62-
* [ ] group commits to `Additions:`, `Minor fixes and documentation:`, `Breaking changes:`
63-
* [ ] delete the `(^M|^A|^D)` lines, `:%!grep -vE '(^M|^A|^D)'`
64-
* [ ] merge multi-commit PRs (so each line has a `(#num)` suffix)
65-
* [ ] drop hash and indent, `:'<,'> s/^\w* /^I* /`
66-
* [ ] a commit bumping `./specs-go/version.go` to next version and empty the `VersionDev` variable
67-
* [ ] a commit adding back the "+dev" to `VersionDev`
68-
* [ ] send email to [email protected]
69-
* [ ] copy the exact commit hash for bumping the version from the pull-request (since master always stays as "-dev")
70-
* [ ] count the PRs since last release (that this version is tracking, in the cases of multiple branching), like `git log --pretty=oneline --no-merges --decorate $priorTag..$versionBumpCommit | grep \(pr\/ | wc -l`
71-
* [ ] get the date for a week from now, like `TZ=UTC date --date='next week'`
72-
* [ ] OPTIONAL find a cute animal gif to attach to the email, and subsequently the release description
73-
* [ ] subject line like `[runtime-spec VOTE] tag $versionBumpCommit as $version (closes $dateWeekFromNowUTC)`
74-
* [ ] email body like
75-
```
57+
- [ ] prepare a pull-request for the release
58+
- [ ] a commit updating `./ChangeLog`
59+
- [ ] `git log --oneline --no-merges --decorate --name-status v1.0.1..HEAD | vim -`
60+
- [ ] `:% s/(pr\/\(\d*\))\(.*\)/\2 (#\1)/` to move the PR to the end of line and match previous formatting
61+
- [ ] review `(^M|^A|^D)` for impact of the commit
62+
- [ ] group commits to `Additions:`, `Minor fixes and documentation:`, `Breaking changes:`
63+
- [ ] delete the `(^M|^A|^D)` lines, `:%!grep -vE '(^M|^A|^D)'`
64+
- [ ] merge multi-commit PRs (so each line has a `(#num)` suffix)
65+
- [ ] drop hash and indent, `:'<,'> s/^\w* /^I* /`
66+
- [ ] a commit bumping `./specs-go/version.go` to next version and empty the `VersionDev` variable
67+
- [ ] a commit adding back the "+dev" to `VersionDev`
68+
- [ ] send email to <[email protected]>
69+
- [ ] copy the exact commit hash for bumping the version from the pull-request (since master always stays as "-dev")
70+
- [ ] count the PRs since last release (that this version is tracking, in the cases of multiple branching), like `git log --pretty=oneline --no-merges --decorate $priorTag..$versionBumpCommit | grep \(pr\/ | wc -l`
71+
- [ ] get the date for a week from now, like `TZ=UTC date --date='next week'`
72+
- [ ] OPTIONAL find a cute animal gif to attach to the email, and subsequently the release description
73+
- [ ] subject line like `[runtime-spec VOTE] tag $versionBumpCommit as $version (closes $dateWeekFromNowUTC)`
74+
- [ ] email body like
75+
76+
```text
7677
Hey everyone,
7778
7879
There have been $numPRs PRs merged since $priorTag release (https://github.com/opencontainers/image-spec/compare/$priorTag...$versionBumpCommit).
@@ -83,14 +84,15 @@ Please respond LGTM or REJECT (with reasoning).
8384
8485
$sig
8586
```
86-
* [ ] edit/update the pull-request to link to the VOTE thread, from https://groups.google.com/a/opencontainers.org/forum/#!forum/dev
87-
* [ ] a week later, if the vote passes, merge the PR
88-
* [ ] `git tag -s $version $versionBumpCommit`
89-
* [ ] `git push --tags`
90-
* [ ] produce release documents
91-
* [ ] git checkout the release tag, like `git checkout $version`
92-
* [ ] `make docs`
93-
* [ ] rename the output PDF and HTML file to include version, like `mv output/oci-runtime-spec.pdf output/oci-runtime-spec-$version.pdf``
94-
* [ ] attach these docs to the release on https://github.com/opencontainers/runtime-spec/releases
95-
* [ ] link to the the VOTE thread and include the passing vote count
96-
* [ ] link to the pull request that merged the release
87+
88+
- [ ] edit/update the pull-request to link to the VOTE thread, from <https://groups.google.com/a/opencontainers.org/forum/#!forum/dev>
89+
- [ ] a week later, if the vote passes, merge the PR
90+
- [ ] `git tag -s $version $versionBumpCommit`
91+
- [ ] `git push --tags`
92+
- [ ] produce release documents
93+
- [ ] git checkout the release tag, like `git checkout $version`
94+
- [ ] `make docs`
95+
- [ ] rename the output PDF and HTML file to include version, like `mv output/oci-runtime-spec.pdf output/oci-runtime-spec-$version.pdf``
96+
- [ ] attach these docs to the release on <https://github.com/opencontainers/runtime-spec/releases>
97+
- [ ] link to the the VOTE thread and include the passing vote count
98+
- [ ] link to the pull request that merged the release

0 commit comments

Comments
 (0)