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

workspace command: convert an if into a cond #442

Open
mhanberg opened this issue Apr 30, 2024 · 0 comments
Open

workspace command: convert an if into a cond #442

mhanberg opened this issue Apr 30, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers workspace-command

Comments

@mhanberg
Copy link
Collaborator

A workspace command that converts an if expression into a cond expression

Example:

defmodule Example do
  def run(foo) do
    if foo do
      :ok
    else
      :error
    end
  end
end

Using the workspace command on the if keyword of the expression will result in:

defmodule Example do
  def run(foo) do
    cond do
      foo ->
        :ok
      true ->
        :error
    end
  end
end

Consider the following:

  • Inline if/else statements (keyword arg verisions
@mhanberg mhanberg added enhancement New feature or request good first issue Good for newcomers workspace-command labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers workspace-command
Projects
None yet
Development

No branches or pull requests

1 participant