Behaviour Spelling

View Source

Behavior attribute names in modules should follow a consistent spelling convention.

Avoid

This is a convention aimed at ensuring consistency, rather than a coding issue.

Depending on your choice, you should avoid:

% the default "avoid".
-behavior(_).

or:

-behaviour(_).

Prefer

Depending on your choice, you should prefer:

% the default "prefer".
-behaviour(_).

or:

-behavior(_).

Rationale

Defining a consistent spelling improves uniformity across your codebase.

Erlang/OTP's proposed default spelling is behaviour, as seen most frequently in the official documentation. However, the spelling behavior is also accepted.

Options

  • spelling :: behaviour | behavior

    • default: behaviour

Example configuration

{elvis_style, behaviour_spelling, #{spelling => behaviour}}