Skip to content

Commit d844a5e

Browse files
sharder996geoffreynyaga
authored andcommitted
[doc] Recover links and formatting in contribution guidelines (#4323)
Recover the hyperlinks and the text formatting that ended up getting lost when transferring the contribution guidelines from a doc. Plus a few more drive-by fixes.
1 parent 6e9c0b3 commit d844a5e

1 file changed

Lines changed: 63 additions & 45 deletions

File tree

CONTRIBUTING.md

Lines changed: 63 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ with governance goals.
3535

3636
**META1.** Everyone in the team can propose additional guidelines.<br>
3737
**META2.** Everyone in the team can question and propose changes to guidelines.<br>
38-
**META3.** Before the first set of guidelines is established, everyone in the team is invited to
38+
**META3.** Before the *first* set of guidelines is established, everyone in the team is invited to
3939
participate in live discussions about them.<br>
4040
**META4.** Before a new version of these guidelines is established, everyone in the team reviews it
4141
independently, except if away on prolonged absence.<br>
42-
**META5.** Ideally, all team members come to agree on any given version of these guidelines before
42+
**META5.** Ideally, all team members come to *agree* on any given version of these guidelines before
4343
it is established.<br>
44-
**META6.** Where that is not possible, preferably a majority of the team agrees with any given
44+
**META6.** Where that is not possible, preferably a majority of the team *agrees* with any given
4545
version of these guidelines before it is established.<br>
46-
**META7.** Preferably, all team members accept the latest established version of these guidelines,
46+
**META7.** Preferably, all team members *accept* the latest established version of these guidelines,
4747
until the team agrees to modify it.<br>
48-
**META8.** In any case, all team members abide by the latest established version of these
48+
**META8.** In any case, all team members *abide* by the latest established version of these
4949
guidelines, until the team agrees to modify it.<br>
5050
**META9.** Established guidelines are taken seriously, but with a grain of salt. They are guidelines
5151
after all, not absolute rules.<br>
@@ -57,11 +57,14 @@ pull requests.<br>
5757

5858
### Core principles (MU)
5959

60-
Principles for the members of the Multipass team. Many of these are inspired by Canonical's values,
60+
Principles for the members of the Multipass team. Many of these are inspired
61+
by [Canonical's values](https://discourse.canonical.com/t/reaffirming-our-company-values/4525),
6162
which we should keep in mind.
6263

6364
**MU1.** Aim at excellence.<br>
64-
**MU2.** Follow best practices (refer to other pertinent documents, e.g.CppCoreGuidelines).<br>
65+
**MU2.**
66+
Follow best practices (refer to other pertinent documents,
67+
e.g. [CppCoreGuidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines)).<br>
6568
**MU3.** Think critically (even about best practices).<br>
6669
**MU4.** Favor collaboration.<br>
6770
**MU5.** Be open to feedback.<br>
@@ -80,31 +83,34 @@ which we should keep in mind.
8083

8184
Descriptive rules of how releases are obtained from Git.
8285

83-
**REL1.** The trunk of Multipass development happens in the main branch, which releases branch out
86+
**REL1.** The trunk of Multipass development happens in the `main` branch, which releases branch out
8487
of.<br>
85-
**REL2.** Preferably, release branches contain only commits that are directly reachable from main or
86-
cherry-picked from it.<br>
88+
**REL2.** Preferably, release branches contain only commits that are directly reachable from `main`
89+
or cherry-picked from it.<br>
8790
**REL3.** Cherry-picked commits in release branches may differ from the original ones only where
8891
necessary to avoid or fix conflicts.<br>
8992
**REL4.** In exceptional cases, release branches may contain dedicated commits for bug, build, or
9093
conflict fixes.<br>
91-
**REL5.** After a release is published, the corresponding release branch is merged back into main.<br>
94+
**REL5.** After a release is published, the corresponding release branch is merged back into
95+
`main`.<br>
9296

9397
### Pull Requests (PR)
9498

9599
Guidelines for how we use and handle pull requests.
96100

97-
**PR1.** Concrete modifications of Multipass can be proposed via Pull Requests (AKA PRs) targeting
98-
the main branch.<br>
99-
**PR2.** Prefer small, single issue PRs.<br>
101+
**PR1.** Concrete modifications of Multipass can be proposed
102+
via [Pull Requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)
103+
(AKA PRs) targeting the `main` branch.<br>
104+
**PR2.** Prefer small, single-issue PRs.<br>
100105
**PR3.** A PR should introduce a coherent change that appears as a unit in a medium or high level of
101106
abstraction.<br>
102-
**PR4.** The main branch is modified exclusively via PRs, except for an empty commit after branching
103-
for release.<br>
104-
**PR5.** PRs accepted into main are merged with merge commits.<br>
105-
**PR6.** PRs to main should typically be covered by automated tests.<br>
107+
**PR4.** The `main` branch is modified exclusively via PRs, except for an empty commit after
108+
branching for release.<br>
109+
**PR5.** PRs accepted into `main` are merged with merge commits.<br>
110+
**PR6.** PRs to `main` should typically be covered by automated tests.<br>
106111
**PR7.** If a PR is valuable on its own, does not depend on others, and does not involve dead code,
107-
target the main branch, even if it is part of a larger task. This should be the most common case.<br>
112+
target the `main` branch, even if it is part of a larger task. This should be the most common
113+
case.<br>
108114
**PR8.** If your PR relies on another one, target the other's branch.<br>
109115
**PR9.** When working on a larger set of changes with cohesive interdependence, consider using a
110116
feature branch.<br>
@@ -128,9 +134,10 @@ is mandatory for external PRs (authored or committed from outside the Multipass
128134
Renovate bot).<br>
129135
**RVW6.** After a PR is approved by multiple people, small updates require only a single additional
130136
approval (i.e. after multiple approvals are dismissed).<br>
131-
**RVW7.** Notably trivial PRs by the Multipass team may be merged after a single primary approval.<br>
137+
**RVW7.** Notably trivial PRs by the Multipass team may be merged after a single primary
138+
approval.<br>
132139
**RVW8.** Renovate PRs may be merged after a single primary approval.<br>
133-
**RVW9.** Review comments should be acknowledged by the author, but resolved by the reviewer.<br>
140+
**RVW9.** Review comments should be acknowledged by the author, but *resolved* by the reviewer.<br>
134141

135142
### Versioning (GIT)
136143

@@ -141,16 +148,21 @@ there should be two commits instead.<br>
141148
**GIT3.** Strive to preserve a clean but detailed git history.<br>
142149
**GIT4.** Avoid squashing.<br>
143150
**GIT5.** Prefer additional commits during review (easier for reviewers to see the diff).<br>
144-
**GIT6.** Avoid merging the target branch back into topic. Rebase instead.<br>
145-
**GIT7.** External contributors are encouraged to sign their commits, while Multipass team members
146-
are required to do so.<br>
151+
**GIT6.** Avoid merging the target branch back into the topic branch. Rebase instead.<br>
152+
**GIT7.** External contributors are encouraged to
153+
[sign their commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits),
154+
while Multipass team members are required to do so.<br>
147155
**GIT8.** Use kebab-case branch names (i.e. lower-case-words-separated-with-hyphens).<br>
148156
**GIT9.** Do not introduce whitespace errors.<br>
149157

150158
### Commit messages (MSG)
151159

152-
Guidelines for writing commit messages for non-merge commits. They are inspired by this and other
153-
posts. The category prefix is the main originality.
160+
Guidelines for writing commit messages for non-merge commits. They are inspired by
161+
[this](https://cbea.ms/git-commit/)
162+
[and](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
163+
[other](https://preslav.me/2015/02/21/what-s-with-the-50-72-rule/)
164+
[posts](https://stackoverflow.com/questions/2290016/git-commit-messages-50-72-formatting).
165+
The category prefix is the main originality.
154166

155167
**MSG1.** Begin with a subject line.<br>
156168
**MSG2.** Start the subject line with a lower-case, single-word category, within square brackets
@@ -167,10 +179,10 @@ try to find a generic unifying category, or choose the most relevant.<br>
167179
**MSG10.** Do not include more than 1 consecutive blank line.<br>
168180
**MSG11.** Use punctuation normally in the body.<br>
169181
**MSG12.** Wrap the body at 72 characters.<br>
170-
**MSG13.** Use the body to explain what and why, rather than how.<br>
182+
**MSG13.** Use the body to explain *what* and *why*, rather than *how*.<br>
171183
**MSG14.** Be descriptive but succinct and avoid filler text.<br>
172184
**MSG15.** Omit the body if the subject is self-explanatory.<br>
173-
**MSG16.** Common abbreviations are fine (e.g. "msg" or "var")<br>
185+
**MSG16.** Common abbreviations are fine (e.g. "msg" or "var").<br>
174186

175187
#### Examples
176188

@@ -188,13 +200,15 @@ code injection (now or in the future).
188200

189201
#### Helper tools
190202

191-
- Consider setting your commit template to the .gitmessage file in the repository root.
192-
- Consider adding the commit-msg file in the repository root as a git hook (in .git/hooks)
203+
- Consider setting your commit template to the `.gitmessage` file in the repository root:
204+
* `git config --local commit.template .gitmessage`
205+
- Consider adding the `commit-msg` file in the repository root as a git hook (in `.git/hooks`)
206+
* `ln -s ../../git-hooks/commit-msg.py .git/hooks/commit-msg`
193207

194208
### Dependencies (DEP)
195209

196210
**DEP1.** Acceptable mechanisms to adopt source-code dependencies are, in decreasing order of
197-
preference: vcpkg (for C++) > FetchContent > submodule.<br>
211+
preference: Vcpkg (for C++) > FetchContent > submodule.<br>
198212
**DEP2.** Avoid vendoring (copied source code).<br>
199213

200214
### Code
@@ -206,12 +220,14 @@ tension and have to be balanced.
206220

207221
**COD1.** Avoid duplicate sources of truth.<br>
208222
**COD2.** Prefer small units, be they functions, classes, files, etc.<br>
209-
**COD3.** Follow SOLID principles.<br>
210-
**COD4.** Pay special attention to the principles of single responsibility and separation of
211-
concerns.<br>
212-
**COD5.** Don't repeat yourself (DRY).<br>
223+
**COD3.** Follow [SOLID principles](https://en.wikipedia.org/wiki/SOLID).<br>
224+
**COD4.** Pay special attention to the principles of
225+
[single responsibility](https://en.wikipedia.org/wiki/Single-responsibility_principle) and
226+
[separation of concerns](https://en.wikipedia.org/wiki/Separation_of_concerns).<br>
227+
**COD5.** Don't repeat yourself ([DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)).<br>
213228
**COD6.** Don't reinvent the wheel.<br>
214-
**COD7.** Don't over-engineer (YAGNI).<br>
229+
**COD7.** Don't
230+
overengineer ([YAGNI](https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it)).<br>
215231
**COD8.** Avoid coupling functionality that isn't logically coupled.<br>
216232
**COD9.** Encapsulate, within each unit, all information that other units don't need.<br>
217233
**COD10.** Encapsulate data with dependent behavior.<br>
@@ -221,31 +237,33 @@ concerns.<br>
221237
**COD14.** All else being equal, less code is better code.<br>
222238
**COD15.** Don't try to maximize LoC metrics.<br>
223239
**COD16.** Aim for consistency.<br>
224-
**COD17.** If it is all the same otherwise, follow a single approach (see how it is done elsewhere).<br>
240+
**COD17.** If it is all the same otherwise, follow a single approach (see how it is done
241+
elsewhere).<br>
225242
**COD18.** Be creative. If you have a better approach, propose it and discuss it openly.<br>
226243
**COD19.** Prioritize. Balance idealism with pragmatism.<br>
227244
**COD20.** Document public, user-facing interfaces.<br>
228245
**COD21.** Keep documentation up to date.<br>
229246

230247
#### C++ (CPP)
231248

232-
**CPP1.** Stick to standard C++17, with the exception of #pragma once.<br>
233-
**CPP2.** Prefer "#pragma once" to header guards<br>
249+
**CPP1.** Stick to standard C++17, with the exception of `#pragma once`.<br>
250+
**CPP2.** Prefer `#pragma once` to header guards<br>
234251
**CPP3.** Prefer enforcing correct usage (prevent misuse) at compilation time.<br>
235-
**CPP4.** If a type isn't meant to be copied or moved, inherit from DisabledCopyMove (either
252+
**CPP4.** If a type isn't meant to be copied or moved, inherit from `DisabledCopyMove` (either
236253
directly or indirectly).<br>
237254
**CPP5.** For such types, define only constructors that fully initialize objects. Avoid a default
238255
constructor unless the object needs no parameterization.<br>
239-
**CPP6.** Make copyable types semi-regular.<br>
256+
**CPP6.** Make copyable
257+
types [semiregular](https://en.cppreference.com/w/cpp/concepts/semiregular).<br>
240258
**CPP7.** Avoid two-stage initialization. Initialize objects fully in the constructor.<br>
241-
**CPP8.** Avoid const by-value params (e.g. no void foo(const bool flag);)<br>
259+
**CPP8.** Avoid const by-value params (e.g. no `void foo(const bool flag);`)<br>
242260
**CPP9.** Encapsulate platform-dependent functionality in dedicated units (types, functions) and do
243-
not use platform #ifdefs (or other platform-conditional logic) outside of those units.<br>
244-
**CPP10.** Use CamelCase for types, but snake_case for variables and functions.<br>
261+
not use platform `#ifdef`s (or other platform-conditional logic) outside of those units.<br>
262+
**CPP10.** Use `CamelCase` for types, but `snake_case` for variables and functions.<br>
245263
**CPP11.** Avoid magic numbers.<br>
246264
**CPP12.** Declare generic constants in a dedicated header.<br>
247265
**CPP13.** Avoid compilation warnings.<br>
248-
**CPP14.** To mock free functions and external APIs, wrap them with MockableSingleton<br>
266+
**CPP14.** To mock free functions and external APIs, wrap them with `MockableSingleton`.<br>
249267

250268
# Further Information
251269

0 commit comments

Comments
 (0)