Skip to content

Deindent comments following hanging assignment #367

Closed
@jbodah

Description

@jbodah

Below we see that the comments do not correctly deindent after the assignment

 defmodule MyApp do
   import Supervisor.Spec
   use Application

   @cluster_id 123
   @registry MyApp.Registry
   @thing MyApp.Thing
   @thing MyApp.Thing
   @thing MyApp.Thing
   @thing MyApp.Thing
   @thing MyApp.Thing
   @thing MyApp.Thing

   # See http://elixir-lang.org/docs/stable/elixir/Application.html
   # for more information on OTP Applications
   def start(_type, _args) do
     MyApp.thing([])

     # Define workers and child supervisors to be supervised
     children = [
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
       worker(MyApp.Thing, []),
     ]

     children =
       if System.get_env("THING") == "1" do
         children ++ [
           supervisor(Thing, [])
         ]
       else
         children
       end

-   # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
-   # for other strategies and supported options
-   opts = [strategy: :rest_for_one, name: MyApp.Supervisor]
-   Supervisor.start_link(children, opts)
+      # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
+      # for other strategies and supported options
+    opts = [strategy: :rest_for_one, name: MyApp.Supervisor]
+    Supervisor.start_link(children, opts)
   end
 end

More specifically:

     children =
       if System.get_env("THING") == "1" do
         children ++ [
           supervisor(Thing, [])
         ]
       else
         children
       end

       # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
       # for other strategies and supported options

should be:

     children =
       if System.get_env("THING") == "1" do
         children ++ [
           supervisor(Thing, [])
         ]
       else
         children
       end

     # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
     # for other strategies and supported options

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions