Skip to content

Commit 4f93dae

Browse files
author
José Valim
committed
Merge pull request #2415 from alco/list-format
Reformat unordered lists in all docstrings
2 parents f90eeaa + 41c74e9 commit 4f93dae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1055
-954
lines changed

lib/eex/lib/eex.ex

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,31 @@ defmodule EEx do
1414
1515
This module provides 3 main APIs for you to use:
1616
17-
1) Evaluate a string (`eval_string`) or a file (`eval_file`)
18-
directly. This is the simplest API to use but also the
19-
slowest, since the code is evaluated and not compiled before;
17+
1. Evaluate a string (`eval_string`) or a file (`eval_file`)
18+
directly. This is the simplest API to use but also the
19+
slowest, since the code is evaluated and not compiled before.
2020
21-
2) Define a function from a string (`function_from_string`)
22-
or a file (`function_from_file`). This allows you to embed
23-
the template as a function inside a module which will then
24-
be compiled. This is the preferred API if you have access
25-
to the template at compilation time;
21+
2. Define a function from a string (`function_from_string`)
22+
or a file (`function_from_file`). This allows you to embed
23+
the template as a function inside a module which will then
24+
be compiled. This is the preferred API if you have access
25+
to the template at compilation time.
2626
27-
3) Compile a string (`compile_string`) or a file (`compile_file`)
28-
into Elixir syntax tree. This is the API used by both functions
29-
above and is available to you if you want to provide your own
30-
ways of handling the compiled template.
27+
3. Compile a string (`compile_string`) or a file (`compile_file`)
28+
into Elixir syntax tree. This is the API used by both functions
29+
above and is available to you if you want to provide your own
30+
ways of handling the compiled template.
3131
3232
## Options
3333
3434
All functions in this module accepts EEx-related options.
3535
They are:
3636
37-
* `:line` - the line to be used as the template start.
38-
Defaults to 1;
39-
* `:file` - the file to be used in the template.
40-
Defaults to the given file the template is read from
41-
or to "nofile" when compiling from a string;
42-
* `:engine` - the EEx engine to be used for compilation.
37+
* `:line` - the line to be used as the template start. Defaults to 1.
38+
* `:file` - the file to be used in the template. Defaults to the given
39+
file the template is read from or to "nofile" when compiling
40+
from a string.
41+
* `:engine` - the EEx engine to be used for compilation.
4342
4443
## Engine
4544

lib/eex/lib/eex/engine.ex

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,22 @@ defmodule EEx.Engine do
33
This is the basic EEx engine that ships with Elixir.
44
An engine needs to implement three functions:
55
6-
* `handle_body(quoted)` - receives the final built quoted
7-
expression, should do final post-processing and return a
8-
quoted expression;
6+
* `handle_body(quoted)` - receives the final built quoted
7+
expression, should do final post-processing and return a
8+
quoted expression.
99
10-
* `handle_text(buffer, text)` - it receives the buffer,
11-
the text and must return a new quoted expression;
10+
* `handle_text(buffer, text)` - it receives the buffer,
11+
the text and must return a new quoted expression.
1212
13-
* `handle_expr(buffer, marker, expr)` - it receives the buffer,
14-
the marker, the expr and must return a new quoted expression;
13+
* `handle_expr(buffer, marker, expr)` - it receives the buffer,
14+
the marker, the expr and must return a new quoted expression.
1515
16-
The marker is what follows exactly after `<%`. For example,
17-
`<% foo %>` has an empty marker, but `<%= foo %>` has `"="`
18-
as marker. The allowed markers so far are:
16+
The marker is what follows exactly after `<%`. For example,
17+
`<% foo %>` has an empty marker, but `<%= foo %>` has `"="`
18+
as marker. The allowed markers so far are: `""` and `"="`.
1919
20-
* `""`
21-
* `"="`
22-
23-
Read `handle_expr/3` below for more information about the markers
24-
implemented by default by this engine.
20+
Read `handle_expr/3` below for more information about the markers
21+
implemented by default by this engine.
2522
"""
2623

2724
use Behaviour

lib/eex/lib/eex/tokenizer.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ defmodule EEx.Tokenizer do
55
Tokenizes the given char list or binary.
66
It returns 4 different types of tokens as result:
77
8-
* {:text, contents}
9-
* {:expr, line, marker, contents}
10-
* {:start_expr, line, marker, contents}
11-
* {:middle_expr, line, marker, contents}
12-
* {:end_expr, line, marker, contents}
8+
* `{:text, contents}`
9+
* `{:expr, line, marker, contents}`
10+
* `{:start_expr, line, marker, contents}`
11+
* `{:middle_expr, line, marker, contents}`
12+
* `{:end_expr, line, marker, contents}`
1313
1414
"""
1515
def tokenize(bin, line) when is_binary(bin) do

lib/elixir/lib/application.ex

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ defmodule Application do
8383
setup where applications takeover and failovers are configured. This particular
8484
aspect of applications can be read with more detail in the OTP documentation:
8585
86-
* http://www.erlang.org/doc/man/application.html
87-
* http://www.erlang.org/doc/design_principles/applications.html
86+
* http://www.erlang.org/doc/man/application.html
87+
* http://www.erlang.org/doc/design_principles/applications.html
8888
8989
A developer may also implement the `stop/1` callback (automatically defined
9090
by `use Application`) which does any application cleanup. It receives the
@@ -152,9 +152,8 @@ defmodule Application do
152152
153153
## Options
154154
155-
* `:timeout` - the timeout for the change (defaults to 5000ms);
156-
157-
* `:persistent` - persists the given value on application load and reloads;
155+
* `:timeout` - the timeout for the change (defaults to 5000ms)
156+
* `:persistent` - persists the given value on application load and reloads
158157
159158
If `put_env/4` is called before the application is loaded, the application
160159
environment values specified in the `.app` file will override the ones
@@ -223,13 +222,16 @@ defmodule Application do
223222
224223
The `type` argument specifies the type of the application:
225224
226-
* `:permanent` - if `app` terminates, all other applications and the entire
227-
node are also terminated;
228-
* `:transient` - if `app` terminates with `:normal` reason, it is reported
229-
but no other applications are terminated. If a transient application terminates
230-
abnormally, all other applications and the entire node are also terminated;
231-
* `:temporary` - if `app` termiantes, it is reported but no other applications
232-
are terminated (the default);
225+
* `:permanent` - if `app` terminates, all other applications and the entire
226+
node are also terminated.
227+
228+
* `:transient` - if `app` terminates with `:normal` reason, it is reported
229+
but no other applications are terminated. If a transient application
230+
terminates abnormally, all other applications and the entire node are
231+
also terminated.
232+
233+
* `:temporary` - if `app` termiantes, it is reported but no other
234+
applications are terminated (the default).
233235
234236
Note that it is always possible to stop an application explicitly by calling
235237
`stop/1`. Regardless of the type of the application, no other applications will

lib/elixir/lib/bitwise.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ defmodule Bitwise do
2424
Allow a developer to use this module in their programs with
2525
the following options:
2626
27-
* `:only_operators` - Include only operators;
28-
* `:skip_operators` - Skip operators;
27+
* `:only_operators` - include only operators
28+
* `:skip_operators` - skip operators
2929
3030
"""
3131
defmacro __using__(options) do

lib/elixir/lib/code.ex

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,24 @@ defmodule Code do
5959
6060
Those options can be:
6161
62-
* `:file` - the file to be considered in the evaluation
63-
* `:line` - the line on which the script starts
64-
* `:delegate_locals_to` - delegate local calls to the given module,
65-
the default is to not delegate
62+
* `:file` - the file to be considered in the evaluation
63+
* `:line` - the line on which the script starts
64+
* `:delegate_locals_to` - delegate local calls to the given module,
65+
the default is to not delegate
6666
6767
Additionally, the following scope values can be configured:
6868
69-
* `:aliases` - a list of tuples with the alias and its target
70-
* `:requires` - a list of modules required
71-
* `:functions` - a list of tuples where the first element is a module
72-
and the second a list of imported function names and arity. The list
73-
of function names and arity must be sorted
74-
* `:macros` - a list of tuples where the first element is a module
75-
and the second a list of imported macro names and arity. The list
76-
of function names and arity must be sorted
69+
* `:aliases` - a list of tuples with the alias and its target
70+
71+
* `:requires` - a list of modules required
72+
73+
* `:functions` - a list of tuples where the first element is a module
74+
and the second a list of imported function names and arity; the list
75+
of function names and arity must be sorted
76+
77+
* `:macros` - a list of tuples where the first element is a module
78+
and the second a list of imported macro names and arity; the list
79+
of function names and arity must be sorted
7780
7881
Notice that setting any of the values above overrides Elixir's default
7982
values. For example, setting `:requires` to `[]`, will no longer
@@ -198,13 +201,13 @@ defmodule Code do
198201
199202
## Options
200203
201-
* `:file` - The filename to be used in stacktraces
202-
and the file reported in the `__ENV__` variable.
204+
* `:file` - the filename to be used in stacktraces
205+
and the file reported in the `__ENV__` variable
203206
204-
* `:line` - The line reported in the `__ENV__` variable.
207+
* `:line` - the line reported in the `__ENV__` variable
205208
206-
* `:existing_atoms_only` - When `true`, raises an error
207-
when non-existing atoms are found by the tokenizer.
209+
* `:existing_atoms_only` - when `true`, raises an error
210+
when non-existing atoms are found by the tokenizer
208211
209212
## Macro.to_string/2
210213
@@ -324,17 +327,18 @@ defmodule Code do
324327
325328
Available options are:
326329
327-
* `:docs` - when `true`, retain documentation in the compiled module,
328-
`true` by default;
330+
* `:docs` - when `true`, retain documentation in the compiled module,
331+
`true` by default
329332
330-
* `:debug_info` - when `true`, retain debug information in the compiled module.
331-
This allows a developer to reconstruct the original source
332-
code, `false` by default;
333+
* `:debug_info` - when `true`, retain debug information in the compiled
334+
module; this allows a developer to reconstruct the original source
335+
code, `false` by default
333336
334-
* `:ignore_module_conflict` - when `true`, override modules that were already defined
335-
without raising errors, `false` by default;
337+
* `:ignore_module_conflict` - when `true`, override modules that were
338+
already defined without raising errors, `false` by default
336339
337-
* `:warnings_as_errors` - cause compilation to fail when warnings are generated;
340+
* `:warnings_as_errors` - cause compilation to fail when warnings are
341+
generated
338342
339343
"""
340344
def compiler_options(opts) do
@@ -472,14 +476,14 @@ defmodule Code do
472476
473477
The return value depends on the `kind` value:
474478
475-
* `:docs` - list of all docstrings attached to functions and macros
476-
using the `@doc` attribute
479+
* `:docs` - list of all docstrings attached to functions and macros
480+
using the `@doc` attribute
477481
478-
* `:moduledoc` - tuple `{<line>, <doc>}` where `line` is the line on
479-
which module definition starts and `doc` is the string
480-
attached to the module using the `@moduledoc` attribute
482+
* `:moduledoc` - tuple `{<line>, <doc>}` where `line` is the line on
483+
which module definition starts and `doc` is the string
484+
attached to the module using the `@moduledoc` attribute
481485
482-
* `:all` - a keyword list with both `:docs` and `:moduledoc`
486+
* `:all` - a keyword list with both `:docs` and `:moduledoc`
483487
484488
"""
485489
def get_docs(module, kind) when is_atom(module) do

lib/elixir/lib/dict.ex

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,36 +49,36 @@ defmodule Dict do
4949
5050
The client module must contain the following functions:
5151
52-
* `delete/2`
53-
* `fetch/2`
54-
* `put/3`
55-
* `reduce/3`
56-
* `size/1`
52+
* `delete/2`
53+
* `fetch/2`
54+
* `put/3`
55+
* `reduce/3`
56+
* `size/1`
5757
5858
All functions, except `reduce/3`, are required by the Dict behaviour.
5959
`reduce/3` must be implemtented as per the Enumerable protocol.
6060
6161
Based on these functions, `Dict` generates default implementations
6262
for the following functions:
6363
64-
* `drop/2`
65-
* `equal?/2`
66-
* `fetch!/2`
67-
* `get/2`
68-
* `get/3`
69-
* `has_key?/2`
70-
* `keys/1`
71-
* `merge/2`
72-
* `merge/3`
73-
* `pop/2`
74-
* `pop/3`
75-
* `put_new/3`
76-
* `split/2`
77-
* `take/2`
78-
* `to_list/1`
79-
* `update/4`
80-
* `update!/3`
81-
* `values/1`
64+
* `drop/2`
65+
* `equal?/2`
66+
* `fetch!/2`
67+
* `get/2`
68+
* `get/3`
69+
* `has_key?/2`
70+
* `keys/1`
71+
* `merge/2`
72+
* `merge/3`
73+
* `pop/2`
74+
* `pop/3`
75+
* `put_new/3`
76+
* `split/2`
77+
* `take/2`
78+
* `to_list/1`
79+
* `update/4`
80+
* `update!/3`
81+
* `values/1`
8282
8383
All of these functions are defined as overridable, so you can provide
8484
your own implementation if needed.

lib/elixir/lib/enum.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ defprotocol Enumerable do
3939
4040
It must be a tagged tuple with one of the following "tags":
4141
42-
* `:cont` - the enumeration should continue
43-
* `:halt` - the enumeration should halt immediately
44-
* `:suspend` - the enumeration should be suspended immediately
42+
* `:cont` - the enumeration should continue
43+
* `:halt` - the enumeration should halt immediately
44+
* `:suspend` - the enumeration should be suspended immediately
4545
4646
Depending on the accumulator value, the result returned by
4747
`Enumerable.reduce/3` will change. Please check the `result`

0 commit comments

Comments
 (0)