Skip to content

Review, revise, or remove run-on defs #116

@christopheradams

Description

@christopheradams

There is a rule under Source Code Layout which reads:

  • ...but run single-line defs that match for the same function together.

    def some_function(nil), do: {:err, "No Value"}
    def some_function([]), do: :ok
    def some_function([first|rest]) do
      some_function(rest)
    end

I'm curious how applicable this is or if there are any edge cases or other issues or problems it causes. Should it be amended? Does anyone have counter-examples?

Thanks to @DavidAntaramian for bringing this up on another channel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions