Skip to content

Improve non-standard messages in @deprecated - #15984

Merged
josevalim merged 3 commits into
elixir-lang:mainfrom
praialabs:deprecated-msgs
Oct 12, 2026
Merged

josevalim merged 3 commits into
elixir-lang:mainfrom
praialabs:deprecated-msgs

Conversation

@rhcarvalho

Copy link
Copy Markdown
Contributor

While reviewing what's coming new in v1.21 and eventually proposing elixir-lang/ex_doc#2274, I noticed a few of the @deprecated messages produced suboptimal documentation in HexDocs and compiler warnings.

Typical deprecation messages follow the formula "Use ... instead".

Problems addressed:

  • Trailing punctuation in the messages cause double period in docs.
  • Backticks, used in @doc markdown text, but not to be used in @deprecated message plain text.
  • Repeating the word "deprecated" instead of providing the alternative.

I reviewed occurrences via git grep -nP '@deprecated |@\w*doc deprecated: ', and decided to only update user-facing ones, ignoring entries with @moduledoc false or @doc false to avoid unnecessary churn.

ExDoc appends a period to the deprecation message in the
`This <%= node.type %> is deprecated. <%= h(deprecated) %>.`
template, resulting in double periods when messages end with punctuation.

Assisted-by: Antigravity:gemini-3.8-flash
Deprecation messages throughout Elixir avoid backticks around identifiers.

Assisted-by: Antigravity:gemini-3.8-flash
ExDoc renders `@typedoc deprecated:` as `This type is deprecated. <message>.`.
Phrasing the message as "The authority field is deprecated" duplicates
the deprecation statement in the documentation. Suggest using the
individual fields instead.

Assisted-by: Antigravity:gemini-3.8-flash
@rhcarvalho

Copy link
Copy Markdown
Contributor Author

@josevalim
josevalim merged commit 6acc44c into elixir-lang:main Oct 12, 2026
15 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

@rhcarvalho
rhcarvalho deleted the deprecated-msgs branch October 13, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants