Skip to content

Instantly share code, notes, and snippets.

@bismark
Last active January 30, 2018 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bismark/6ec186b0b5bd0452371904c7ead59e04 to your computer and use it in GitHub Desktop.
Save bismark/6ec186b0b5bd0452371904c7ead59e04 to your computer and use it in GitHub Desktop.
Interesting `mix format` output in elixir 1.6.0
# No Defaults
defmodule Test11 do
defstruct [:foo1, :foo2, :foo3, :foo4, :foo5, :foo6, :foo7, :foo8, :foo9, :foo10, :foo11, :foo12, :foo13, :foo14]
end
defmodule Test12 do
defstruct([:foo1, :foo2, :foo3, :foo4, :foo5, :foo6, :foo7, :foo8, :foo9, :foo10, :foo11, :foo12, :foo13, :foo14])
end
# Mixed defaults
defmodule Test21 do
defstruct [:foo1, :foo2, :foo3, :foo4, :foo5, :foo6, :foo7, :foo8, :foo9, :foo10, :foo11, :foo12, :foo13, foo14: true]
end
defmodule Test22 do
defstruct([:foo1, :foo2, :foo3, :foo4, :foo5, :foo6, :foo7, :foo8, :foo9, :foo10, :foo11, :foo12, :foo13, foo14: true])
end
# All defaults
defmodule Test31 do
defstruct [foo1: true, foo2: true, foo3: true, foo4: true, foo5: true, foo6: true, foo7: true, foo8: true, foo9: true, foo10: true, foo11: true, foo12: true, foo13: true, foo14: true]
end
defmodule Test32 do
defstruct([foo1: true, foo2: true, foo3: true, foo4: true, foo5: true, foo6: true, foo7: true, foo8: true, foo9: true, foo10: true, foo11: true, foo12: true, foo13: true, foo14: true])
end
defmodule Test33 do
defstruct(foo1: true, foo2: true, foo3: true, foo4: true, foo5: true, foo6: true, foo7: true, foo8: true, foo9: true, foo10: true, foo11: true, foo12: true, foo13: true, foo14: true)
end
defmodule Test34 do
defstruct foo1: true, foo2: true, foo3: true, foo4: true, foo5: true, foo6: true, foo7: true, foo8: true, foo9: true, foo10: true, foo11: true, foo12: true, foo13: true, foo14: true
end
# No Defaults
defmodule Test11 do
defstruct [
:foo1,
:foo2,
:foo3,
:foo4,
:foo5,
:foo6,
:foo7,
:foo8,
:foo9,
:foo10,
:foo11,
:foo12,
:foo13,
:foo14
]
end
defmodule Test12 do
defstruct([
:foo1,
:foo2,
:foo3,
:foo4,
:foo5,
:foo6,
:foo7,
:foo8,
:foo9,
:foo10,
:foo11,
:foo12,
:foo13,
:foo14
])
end
# Mixed defaults
defmodule Test21 do
defstruct [
:foo1,
:foo2,
:foo3,
:foo4,
:foo5,
:foo6,
:foo7,
:foo8,
:foo9,
:foo10,
:foo11,
:foo12,
:foo13,
foo14: true
]
end
defmodule Test22 do
defstruct([
:foo1,
:foo2,
:foo3,
:foo4,
:foo5,
:foo6,
:foo7,
:foo8,
:foo9,
:foo10,
:foo11,
:foo12,
:foo13,
foo14: true
])
end
# All defaults
defmodule Test31 do
defstruct foo1: true,
foo2: true,
foo3: true,
foo4: true,
foo5: true,
foo6: true,
foo7: true,
foo8: true,
foo9: true,
foo10: true,
foo11: true,
foo12: true,
foo13: true,
foo14: true
end
defmodule Test32 do
defstruct(
foo1: true,
foo2: true,
foo3: true,
foo4: true,
foo5: true,
foo6: true,
foo7: true,
foo8: true,
foo9: true,
foo10: true,
foo11: true,
foo12: true,
foo13: true,
foo14: true
)
end
defmodule Test33 do
defstruct(
foo1: true,
foo2: true,
foo3: true,
foo4: true,
foo5: true,
foo6: true,
foo7: true,
foo8: true,
foo9: true,
foo10: true,
foo11: true,
foo12: true,
foo13: true,
foo14: true
)
end
defmodule Test34 do
defstruct foo1: true,
foo2: true,
foo3: true,
foo4: true,
foo5: true,
foo6: true,
foo7: true,
foo8: true,
foo9: true,
foo10: true,
foo11: true,
foo12: true,
foo13: true,
foo14: true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment