Here lie the heretofore-unwritten rules and styles we use when writing documentation, issues, pull requests, and other forms of written expression.
Follow standard capitalization for written work such as comments, documentation, reports, and emails, namely that
words are lowercase unless there is specific guidance to capitalize them. For example, capitalize the first word of a sentence, unless the sentence begins with the name of a person whose name starts with a lowercase letter.
Reference: APA's capitalization guidelines
When an object being referenced has a nonstandard capitalization, defer to its capitalization. For example, GitHub has a capital letter mid-word.
Use uppercase for abbreviations, including technical protocols such as HTTPS and SSL.
Please note that this guidance is specifically for written work such as documentation and that code capitalization has its own standards that vary by language.
All repositories should be public.
Whether creating new repositories or transferring existing repositories, remember that we work in the open by default. For a discussion of the rare cases in which we might use private repositories, read our open source policy.
Use a repository's name to describe its purpose. Names should be:
- Descriptive
- Readable
- Consistent
- Contextual
- Future-friendly
- Extensible
- Reusable
Avoid references to pop culture or other implicit references. GitLab has a good guide on using inclusive language in documentation.
Specifically, when naming a repository:
- Use lower case
- Use dashes
- For readability, where spaces would otherwise separate words
- Avoid underscores, which require extra keystrokes
Specify code owners in each repository's .github/codeowners
file to make
sure that changes and pull requests are reviewed by people familiar with
the codebase. This way, we'll catch more problems before they get into the
protected branch.
- Set a minimum of two code owners for all repositories.
- Add or edit each repository's
.github/codeowners
file.
- Add or edit each repository's
- Set up branch protection.
Use title case for the main title of a document.
Use sentence case for headings within a document that are not the inital document title.
When referencing an object or another document, use the capitalization of the referenced item, such as "GitHub" or "the Style Guide".
Use both opening and closing octothorpes (#
) to indicate the Markdown header
level. Our Markdown linting enforces this as well.
For example:
### Use variables to configure pipelines ###
## Using the Style Guide ##
Use bulleted lists unless order matters, in which case use numbered lists.
Always capitalize the first word of list items, unless they’re parameters or commands that are in backticks, or a similar situation.
Periods or no periods?
- Use periods at the end of bullets that are full sentences.
- Omit periods at the end of partial sentences.
- Match the rest of the bulleted or numbered list as much as possible.
When formatting code blocks, use the formatting that best highlights the syntax in the code block.
We generally use code blocks for scripts, command-line usage, and when showing file contents like configuration files.
- Use
shell
formatting for shell scriptsshell
is also aliased assh
,bash
,zsh
, and others
- Use language-specific formatting, such as
python
, for blocks with scripts written in specific languages- Reference the GitHub list of supported languages
-
console
is most effective at highlighting a command and its resulting output, like this:$ the_first_command the output more output $ the_second_command yet more output
-
shell
should be used for result-less commands, especially if there is any shell-fu like pipes, file redirects, shell variables, etc. to apply syntax highlighting so the reader is more aware of the magic happening
- Extension-specific formatting, such as
hcl
for Terraform, should be used