Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add names to arguments in functions' specs #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

McSym28
Copy link
Contributor

@McSym28 McSym28 commented Sep 11, 2024

Instead of:

  @spec get_an_album(String.t(), keyword) ::
          {:ok, Example.AlbumObject.t()} | {:error, GitHub.Error.t()}

we'll now have:

  @spec get_an_album(id :: String.t(), opts :: keyword) ::
          {:ok, Example.AlbumObject.t()} | {:error, GitHub.Error.t()}

Motivation (from Elixir documentation):

This is particularly useful in documentation as a way to differentiate multiple arguments of the same type (or multiple elements of the same type in a type definition)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant