1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 01:02:09 +02:00

style-guide: add section on serial comma (#6256)

This commit is contained in:
Seth Falco 2021-07-25 22:17:28 +02:00 committed by GitHub
parent af41cf8d9e
commit cabd356464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,3 +76,18 @@ Use backticks on the following:
1. Paths, ex. `package.json`, `/etc/package.json`.
2. Extensions, ex. `.dll`.
3. Commands, ex. `ls`.
## Serial Comma
When declaring a list of 3 or more items, use a [serial comma](https://en.wikipedia.org/wiki/Serial_comma), also known as the Oxford comma.
When the serial comma is ommitted, it can create ambiguity.
> Delete the Git branches, tags and remotes.
The example above does not use a serial comma, so this could mean one of two things:
* Delete the Git branches named `tags` and `remotes`.
* Delete all of the following, Git branches, Git tags, and Git remotes.
This can be resolved by inserting a comma before the "and" or "or" in the final element in the list.
> Delete the Git branches, tags, and remotes.