Skip to content

Commit 8cde231

Browse files
authored
behaviour -> behavior when not about OTP behaviours (#13240)
1 parent b1a3e26 commit 8cde231

38 files changed

+91
-91
lines changed

Diff for: lib/elixir/lib/code.ex

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ defmodule Code do
33
Utilities for managing code compilation, code evaluation, and code loading.
44
55
This module complements Erlang's [`:code` module](`:code`)
6-
to add behaviour which is specific to Elixir. For functions to
6+
to add behavior which is specific to Elixir. For functions to
77
manipulate Elixir's AST (rather than evaluating it), see the
88
`Macro` module.
99
1010
## Working with files
1111
1212
This module contains three functions for compiling and evaluating files.
13-
Here is a summary of them and their behaviour:
13+
Here is a summary of them and their behavior:
1414
1515
* `require_file/2` - compiles a file and tracks its name. It does not
1616
compile the file again if it has been previously required.
@@ -710,8 +710,8 @@ defmodule Code do
710710
specially because a function is named `defmodule`, `def`, or the like. This
711711
principle mirrors Elixir's goal of being an extensible language where
712712
developers can extend the language with new constructs as if they were
713-
part of the language. When it is absolutely necessary to change behaviour
714-
based on the name, this behaviour should be configurable, such as the
713+
part of the language. When it is absolutely necessary to change behavior
714+
based on the name, this behavior should be configurable, such as the
715715
`:locals_without_parens` option.
716716
717717
## Running the formatter
@@ -855,7 +855,7 @@ defmodule Code do
855855
* Newlines before certain operators (such as the pipeline operators)
856856
and before other operators (such as comparison operators)
857857
858-
The behaviours above are not guaranteed. We may remove or add new
858+
The behaviors above are not guaranteed. We may remove or add new
859859
rules in the future. The goal of documenting them is to provide better
860860
understanding on what to expect from the formatter.
861861
@@ -1145,7 +1145,7 @@ defmodule Code do
11451145
11461146
* `:static_atoms_encoder` - the static atom encoder function, see
11471147
"The `:static_atoms_encoder` function" section below. Note this
1148-
option overrides the `:existing_atoms_only` behaviour for static
1148+
option overrides the `:existing_atoms_only` behavior for static
11491149
atoms but `:existing_atoms_only` is still used for dynamic atoms,
11501150
such as atoms with interpolations.
11511151
@@ -1627,7 +1627,7 @@ defmodule Code do
16271627
error. You may be set it to `:warn` if you want undefined variables to
16281628
emit a warning and expand as to a local call to the zero-arity function
16291629
of the same name (for example, `node` would be expanded as `node()`).
1630-
This `:warn` behaviour only exists for compatibility reasons when working
1630+
This `:warn` behavior only exists for compatibility reasons when working
16311631
with old dependencies.
16321632
16331633
It always returns `:ok`. Raises an error for invalid options.
@@ -1961,7 +1961,7 @@ defmodule Code do
19611961
@doc """
19621962
Returns `true` if the module is loaded.
19631963
1964-
This function doesn't attempt to load the module. For such behaviour,
1964+
This function doesn't attempt to load the module. For such behavior,
19651965
`ensure_loaded?/1` can be used.
19661966
19671967
## Examples

Diff for: lib/elixir/lib/collectable.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ end
9494

9595
defimpl Collectable, for: List do
9696
def into(list) do
97-
# TODO: Change the behaviour so the into always comes last on Elixir v2.0
97+
# TODO: Change the behavior so the into always comes last on Elixir v2.0
9898
if list != [] do
9999
IO.warn(
100-
"the Collectable protocol is deprecated for non-empty lists. The behaviour of " <>
100+
"the Collectable protocol is deprecated for non-empty lists. The behavior of " <>
101101
"Enum.into/2 and \"for\" comprehensions with an :into option is incorrect " <>
102102
"when collecting into non-empty lists. If you're collecting into a non-empty keyword " <>
103103
"list, consider using Keyword.merge/2 instead. If you're collecting into a non-empty " <>

Diff for: lib/elixir/lib/config/provider.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ defmodule Config.Provider do
312312
"""
313313
the application #{inspect(app)} has a different value set #{path(key, path)} \
314314
during runtime compared to compile time. Since this application environment entry was \
315-
marked as compile time, this difference can lead to different behaviour than expected:
315+
marked as compile time, this difference can lead to different behavior than expected:
316316
317317
* Compile time value #{return_to_text(compile_return)}
318318
* Runtime value #{return_to_text(runtime_return)}

Diff for: lib/elixir/lib/enum.ex

+4-4
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,12 @@ defmodule Enum do
269269
After all, if we want to traverse every element on a list, the longer the
270270
list, the more elements we need to traverse, and the longer it will take.
271271
272-
This linear behaviour should also be expected on operations like `count/1`,
272+
This linear behavior should also be expected on operations like `count/1`,
273273
`member?/2`, `at/2` and similar. While Elixir does allow data types to
274274
provide performant variants for such operations, you should not expect it
275275
to always be available, since the `Enum` module is meant to work with a
276276
large variety of data types and not all data types can provide optimized
277-
behaviour.
277+
behavior.
278278
279279
Finally, note the functions in the `Enum` module are eager: they will
280280
traverse the enumerable as soon as they are invoked. This is particularly
@@ -4020,7 +4020,7 @@ defmodule Enum do
40204020
@doc """
40214021
Reduces over two enumerables halting as soon as either enumerable is empty.
40224022
4023-
In practice, the behaviour provided by this function can be achieved with:
4023+
In practice, the behavior provided by this function can be achieved with:
40244024
40254025
Enum.reduce(Stream.zip(left, right), acc, reducer)
40264026
@@ -4054,7 +4054,7 @@ defmodule Enum do
40544054
The reducer will receive 2 args: a list of elements (one from each enum) and the
40554055
accumulator.
40564056
4057-
In practice, the behaviour provided by this function can be achieved with:
4057+
In practice, the behavior provided by this function can be achieved with:
40584058
40594059
Enum.reduce(Stream.zip(enums), acc, reducer)
40604060

Diff for: lib/elixir/lib/file.ex

+4-4
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ defmodule File do
758758
759759
Note: The command `mv` in Unix-like systems behaves differently depending on
760760
whether `source` is a file and the `destination` is an existing directory.
761-
We have chosen to explicitly disallow this behaviour.
761+
We have chosen to explicitly disallow this behavior.
762762
763763
## Examples
764764
@@ -822,7 +822,7 @@ defmodule File do
822822
The function receives arguments for `source_file` and `destination_file`. It should
823823
return `true` if the existing file should be overwritten, `false` if otherwise.
824824
The default callback returns `true`. On earlier versions, this callback could be
825-
given as third argument, but such behaviour is now deprecated.
825+
given as third argument, but such behavior is now deprecated.
826826
827827
"""
828828
@spec cp(Path.t(), Path.t(), on_conflict: on_conflict_callback) :: :ok | {:error, posix}
@@ -895,7 +895,7 @@ defmodule File do
895895
896896
Note: The command `cp` in Unix-like systems behaves differently depending on
897897
whether `destination` is an existing directory or not. We have chosen to
898-
explicitly disallow this behaviour. If `source` is a `file` and `destination`
898+
explicitly disallow this behavior. If `source` is a `file` and `destination`
899899
is a directory, `{:error, :eisdir}` will be returned.
900900
901901
## Options
@@ -904,7 +904,7 @@ defmodule File do
904904
The function receives arguments for `source` and `destination`. It should return
905905
`true` if the existing file should be overwritten, `false` if otherwise. The default
906906
callback returns `true`. On earlier versions, this callback could be given as third
907-
argument, but such behaviour is now deprecated.
907+
argument, but such behavior is now deprecated.
908908
909909
* `:dereference_symlinks` - (since v1.14.0) By default, this function will copy symlinks
910910
by creating symlinks that point to the same location. This option forces symlinks to be

Diff for: lib/elixir/lib/float.ex

+7-7
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,15 @@ defmodule Float do
210210
211211
## Known issues
212212
213-
The behaviour of `floor/2` for floats can be surprising. For example:
213+
The behavior of `floor/2` for floats can be surprising. For example:
214214
215215
iex> Float.floor(12.52, 2)
216216
12.51
217217
218218
One may have expected it to floor to 12.52. This is not a bug.
219219
Most decimal fractions cannot be represented as a binary floating point
220220
and therefore the number above is internally represented as 12.51999999,
221-
which explains the behaviour above.
221+
which explains the behavior above.
222222
223223
## Examples
224224
@@ -254,15 +254,15 @@ defmodule Float do
254254
The operation is performed on the binary floating point, without a
255255
conversion to decimal.
256256
257-
The behaviour of `ceil/2` for floats can be surprising. For example:
257+
The behavior of `ceil/2` for floats can be surprising. For example:
258258
259259
iex> Float.ceil(-12.52, 2)
260260
-12.51
261261
262262
One may have expected it to ceil to -12.52. This is not a bug.
263263
Most decimal fractions cannot be represented as a binary floating point
264264
and therefore the number above is internally represented as -12.51999999,
265-
which explains the behaviour above.
265+
which explains the behavior above.
266266
267267
This function always returns floats. `Kernel.trunc/1` may be used instead to
268268
truncate the result to an integer afterwards.
@@ -305,16 +305,16 @@ defmodule Float do
305305
306306
## Known issues
307307
308-
The behaviour of `round/2` for floats can be surprising. For example:
308+
The behavior of `round/2` for floats can be surprising. For example:
309309
310310
iex> Float.round(5.5675, 3)
311311
5.567
312312
313313
One may have expected it to round to the half up 5.568. This is not a bug.
314314
Most decimal fractions cannot be represented as a binary floating point
315315
and therefore the number above is internally represented as 5.567499999,
316-
which explains the behaviour above. If you want exact rounding for decimals,
317-
you must use a decimal library. The behaviour above is also in accordance
316+
which explains the behavior above. If you want exact rounding for decimals,
317+
you must use a decimal library. The behavior above is also in accordance
318318
to reference implementations, such as "Correctly Rounded Binary-Decimal and
319319
Decimal-Binary Conversions" by David M. Gay.
320320

Diff for: lib/elixir/lib/io/ansi.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ defmodule IO.ANSI do
268268
The named sequences are represented by atoms.
269269
270270
It will also append an `IO.ANSI.reset/0` to the chardata when a conversion is
271-
performed. If you don't want this behaviour, use `format_fragment/2`.
271+
performed. If you don't want this behavior, use `format_fragment/2`.
272272
273273
An optional boolean parameter can be passed to enable or disable
274274
emitting actual ANSI codes. When `false`, no ANSI codes will be emitted.

Diff for: lib/elixir/lib/kernel.ex

+7-7
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ defmodule Kernel do
125125
### Supporting documents
126126
127127
Under the "Pages" section in sidebar you will find tutorials, guides,
128-
and reference documents that outline Elixir semantics and behaviours
128+
and reference documents that outline Elixir semantics and behaviors
129129
in more detail. Those are:
130130
131131
* [Compatibility and deprecations](compatibility-and-deprecations.md) - lists
@@ -548,10 +548,10 @@ defmodule Kernel do
548548
* `exit({:shutdown, term})`
549549
550550
Exiting with any other reason is considered abnormal and treated
551-
as a crash. This means the default supervisor behaviour kicks in,
551+
as a crash. This means the default supervisor behavior kicks in,
552552
error reports are emitted, and so forth.
553553
554-
This behaviour is relied on in many different places. For example,
554+
This behavior is relied on in many different places. For example,
555555
`ExUnit` uses `exit(:shutdown)` when exiting the test process to
556556
signal linked processes, supervision trees and so on to politely
557557
shut down too.
@@ -2362,7 +2362,7 @@ defmodule Kernel do
23622362
Keys in the `Enumerable` that don't exist in the struct are automatically
23632363
discarded. Note that keys must be atoms, as only atoms are allowed when
23642364
defining a struct. If there are duplicate keys in the `Enumerable`, the last
2365-
entry will be taken (same behaviour as `Map.new/1`).
2365+
entry will be taken (same behavior as `Map.new/1`).
23662366
23672367
This function is useful for dynamically creating and updating structs, as
23682368
well as for converting maps to structs; in the latter case, just inserting
@@ -2410,7 +2410,7 @@ defmodule Kernel do
24102410
@doc """
24112411
Similar to `struct/2` but checks for key validity.
24122412
2413-
The function `struct!/2` emulates the compile time behaviour
2413+
The function `struct!/2` emulates the compile time behavior
24142414
of structs. This means that:
24152415
24162416
* when building a struct, as in `struct!(SomeStruct, key: :value)`,
@@ -3389,7 +3389,7 @@ defmodule Kernel do
33893389
33903390
The pin operator will check if the values are equal, using `===/2`, while
33913391
patterns have their own rules when matching maps, lists, and so forth.
3392-
Such behaviour is not specific to `match?/2`. The following code also
3392+
Such behavior is not specific to `match?/2`. The following code also
33933393
throws an exception:
33943394
33953395
attrs = %{x: 1}
@@ -3928,7 +3928,7 @@ defmodule Kernel do
39283928
one element, which is the number itself.
39293929
39303930
If first is more than last, the range will be decreasing from first
3931-
to last, albeit this behaviour is deprecated. Instead prefer to
3931+
to last, albeit this behavior is deprecated. Instead prefer to
39323932
explicitly list the step with `first..last//-1`.
39333933
39343934
See the `Range` module for more information.

Diff for: lib/elixir/lib/kernel/special_forms.ex

+7-7
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ defmodule Kernel.SpecialForms do
550550
Elixir won't emit any warnings though, since the alias
551551
was not explicitly defined.
552552
553-
Both warning behaviours could be changed by explicitly
553+
Both warning behaviors could be changed by explicitly
554554
setting the `:warn` option to `true` or `false`.
555555
556556
"""
@@ -674,7 +674,7 @@ defmodule Kernel.SpecialForms do
674674
Elixir won't emit any warnings though, since the import
675675
was not explicitly defined.
676676
677-
Both warning behaviours could be changed by explicitly
677+
Both warning behaviors could be changed by explicitly
678678
setting the `:warn` option to `true` or `false`.
679679
680680
## Ambiguous function/macro names
@@ -888,7 +888,7 @@ defmodule Kernel.SpecialForms do
888888
At first, there is nothing in this example that actually reveals it is a
889889
macro. But what is happening is that, at compilation time, `squared(5)`
890890
becomes `5 * 5`. The argument `5` is duplicated in the produced code, we
891-
can see this behaviour in practice though because our macro actually has
891+
can see this behavior in practice though because our macro actually has
892892
a bug:
893893
894894
import Math
@@ -915,7 +915,7 @@ defmodule Kernel.SpecialForms do
915915
my_number.() * my_number.()
916916
917917
Which invokes the function twice, explaining why we get the printed value
918-
twice! In the majority of the cases, this is actually unexpected behaviour,
918+
twice! In the majority of the cases, this is actually unexpected behavior,
919919
and that's why one of the first things you need to keep in mind when it
920920
comes to macros is to **not unquote the same value more than once**.
921921
@@ -1444,7 +1444,7 @@ defmodule Kernel.SpecialForms do
14441444
[elixir: :prolog]
14451445
14461446
Given the grandparents of Erlang and Prolog were nil, those values were
1447-
filtered out. If you don't want this behaviour, a simple option is to
1447+
filtered out. If you don't want this behavior, a simple option is to
14481448
move the filter inside the do-block:
14491449
14501450
iex> languages = [elixir: :erlang, erlang: :prolog, prolog: nil]
@@ -1496,7 +1496,7 @@ defmodule Kernel.SpecialForms do
14961496
14971497
*Available since Elixir v1.8*.
14981498
1499-
While the `:into` option allows us to customize the comprehension behaviour
1499+
While the `:into` option allows us to customize the comprehension behavior
15001500
to a given data type, such as putting all of the values inside a map or inside
15011501
a binary, it is not always enough.
15021502
@@ -1624,7 +1624,7 @@ defmodule Kernel.SpecialForms do
16241624
iex> width
16251625
nil
16261626
1627-
The behaviour of any expression in a clause is the same as if it was
1627+
The behavior of any expression in a clause is the same as if it was
16281628
written outside of `with`. For example, `=` will raise a `MatchError`
16291629
instead of returning the non-matched value:
16301630

Diff for: lib/elixir/lib/list.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ defmodule List do
107107
charlists in IEx when you encounter them, which shows you the type, description
108108
and also the raw representation in one single summary.
109109
110-
The rationale behind this behaviour is to better support
110+
The rationale behind this behavior is to better support
111111
Erlang libraries which may return text as charlists
112112
instead of Elixir strings. In Erlang, charlists are the default
113113
way of handling strings, while in Elixir it's binaries. One

Diff for: lib/elixir/lib/module/types/helpers.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ defmodule Module.Types.Helpers do
2727
#{hint()} all expressions given to binaries are assumed to be of type \
2828
integer() unless said otherwise. For example, <<expr>> assumes "expr" \
2929
is an integer. Pass a modifier, such as <<expr::float>> or <<expr::binary>>, \
30-
to change the default behaviour.
30+
to change the default behavior.
3131
"""
3232
end)
3333
end

Diff for: lib/elixir/lib/path.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ defmodule Path do
261261
Path.relative("/bar/foo.ex") #=> "bar/foo.ex"
262262
263263
"""
264-
# Note this function does not expand paths because the behaviour
264+
# Note this function does not expand paths because the behavior
265265
# is ambiguous. If we expand it before converting to relative, then
266266
# "/usr/../../foo" means "/foo". If we expand it after, it means "../foo".
267267
# We could expand only relative paths but it is best to say it never

Diff for: lib/elixir/lib/process.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ defmodule Process do
195195
@doc """
196196
Sends an exit signal with the given `reason` to `pid`.
197197
198-
The following behaviour applies if `reason` is any term except `:normal`
198+
The following behavior applies if `reason` is any term except `:normal`
199199
or `:kill`:
200200
201201
1. If `pid` is not trapping exits, `pid` will exit with the given
@@ -624,7 +624,7 @@ defmodule Process do
624624
exits with a reason other than `:normal` (which is also the exit reason used
625625
when a process finishes its job) and `pid1` is not trapping exits (see
626626
`flag/2`), then `pid1` will exit with the same reason as `pid2` and in turn
627-
emit an exit signal to all its other linked processes. The behaviour when
627+
emit an exit signal to all its other linked processes. The behavior when
628628
`pid1` is trapping exits is described in `exit/2`.
629629
630630
See `:erlang.link/1` for more information.

Diff for: lib/elixir/lib/protocol.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ defmodule Protocol do
126126
Although the implementation above is arguably not a reasonable
127127
one. For example, it makes no sense to say a PID or an integer
128128
have a size of `0`. That's one of the reasons why `@fallback_to_any`
129-
is an opt-in behaviour. For the majority of protocols, raising
130-
an error when a protocol is not implemented is the proper behaviour.
129+
is an opt-in behavior. For the majority of protocols, raising
130+
an error when a protocol is not implemented is the proper behavior.
131131
132132
## Multiple implementations
133133

0 commit comments

Comments
 (0)