View Source Quokka.Style.Configs (Quokka v2.4.1)

Orders Config.config/2,3 stanzas in configuration files.

  • ordering is done only within immediate-sibling config statements
  • assignments are moved above the configuration blocks
  • any non config/2,3 or assignment (=/2) calls mark the end of a sorting block. this is support having conditional blocks (if/case/cond) and import_config stanzas between blocks

Breakages

If you configure the same values multiple times, Quokka may swap their orders

Before

line 04: config :foo, bar: :zab line 40: config :foo, bar: :baz

# Application.fetch_env!(:foo)[:bar] => :baz

After

line 04: config :foo, bar: :baz line 05: config :foo, bar: :zab

# Application.fetch_env!(:foo)[:bar] => :zab

Fix

The reason Quokka sorts configuration is to help you noticed these duplicated configuration stanzas. Delete the duplicative/erroneous stanza and life will be good.

Summary

Functions