Skip to content

Commit a787ac3

Browse files
committed
Update some docstring examples to match the common community practice
1 parent f605618 commit a787ac3

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,8 +1645,8 @@ the docstring at various places.
16451645
# good
16461646
(defn frobnitz
16471647
"This function does a frobnitz.
1648-
It will do gnorwatz to achieve this, but only under certain
1649-
cricumstances"
1648+
It will do gnorwatz to achieve this, but only under certain
1649+
cricumstances"
16501650
[]
16511651
...)
16521652
@@ -1668,14 +1668,14 @@ functionality for them.
16681668
# good
16691669
(defn watsitz
16701670
"Watsitz takes a `frob` and converts it to a znoot.
1671-
When the `frob` is negative, the znoot becomes angry."
1671+
When the `frob` is negative, the znoot becomes angry."
16721672
[frob]
16731673
...)
16741674
16751675
# bad
16761676
(defn watsitz
16771677
"Watsitz takes a frob and converts it to a znoot.
1678-
When the frob is negative, the znoot becomes angry."
1678+
When the frob is negative, the znoot becomes angry."
16791679
[frob]
16801680
...)
16811681
```
@@ -1689,14 +1689,14 @@ can identify them.
16891689
# good
16901690
(defn wombat
16911691
"Acts much like `clojure.core/identity` except when it doesn't.
1692-
Takes `x` as an argument and returns that. If it feels like it."
1692+
Takes `x` as an argument and returns that. If it feels like it."
16931693
[x]
16941694
...)
16951695
16961696
# bad
16971697
(defn wombat
16981698
"Acts much like clojure.core/identity except when it doesn't.
1699-
Takes `x` as an argument and returns that. If it feels like it."
1699+
Takes `x` as an argument and returns that. If it feels like it."
17001700
[x]
17011701
...)
17021702
```
@@ -1711,33 +1711,32 @@ should be separated with a single space.
17111711
# good
17121712
(def foo
17131713
"All sentences should end with a period (or maybe an exclamation mark).
1714-
And the period should be followed by a space, unless it's the last sentence.")
1714+
And the period should be followed by a space, unless it's the last sentence.")
17151715
17161716
# bad
17171717
(def foo
17181718
"all sentences should end with a period (or maybe an exclamation mark).
1719-
And the period should be followed by a space, unless it's the last sentence")
1719+
And the period should be followed by a space, unless it's the last sentence")
17201720
```
17211721
17221722
* <a name="docstring-indentation"></a>
1723-
Don't indent your docstrings as that makes it harder for tooling to
1724-
format them correctly.
1723+
Indent multi-line docstrings by two spaces.
17251724
<sup>[[link](#docstring-indentation)]</sup>
17261725
17271726
```clojure
17281727
# good
17291728
(ns my.ns
17301729
"It is actually possible to document a ns.
1731-
It's a nice place to describe the purpose of the namespace and maybe even
1732-
the overall conventions used. Note how _not_ indenting the doc string makes
1733-
it easier for tooling to display it correctly.")
1730+
It's a nice place to describe the purpose of the namespace and maybe even
1731+
the overall conventions used. Note how _not_ indenting the doc string makes
1732+
it easier for tooling to display it correctly.")
17341733
17351734
# bad
17361735
(ns my.ns
17371736
"It is actually possible to document a ns.
1738-
It's a nice place to describe the purpose of the namespace and maybe even
1739-
the overall conventions used. Note how _not_ indenting the doc string makes
1740-
it easier for tooling to display it correctly.")
1737+
It's a nice place to describe the purpose of the namespace and maybe even
1738+
the overall conventions used. Note how _not_ indenting the doc string makes
1739+
it easier for tooling to display it correctly.")
17411740
```
17421741
17431742
* <a name="docstring-leading-trailing-whitespace"></a>

0 commit comments

Comments
 (0)