As discussed in this phoenix issue 
<https://github.com/phoenixframework/phoenix/issues/2605> the current 
formatter configuration interface for a mix project forces its users to 
apply the configured style across the whole formatted codebase.
While this behavior should be fine for simple settings like *line_length*, 
when we introduced the *:import_deps* option, this behavior may be getting 
in our way.

Consider a library module specifying a DSL, like Phoenix.Router. It may 
*export* a *locals_without_parens *configuration with a list of functions 
like *options/3 *or *get/3.* A user of such library may want to apply these 
settings only for his project's source files that use this DSL in order to 
keep the usual formatting for *other* *options/3 *and *get/3* functions 
which may be present in his project.

An example configuration format is presented in this github comment under 
the same issue 
<https://github.com/phoenixframework/phoenix/issues/2605#issuecomment-357190873>
.

Additionally, I would propose to extend the *export* and *import_deps* 
options to allow exporting/importing only a part of library's formatter 
configuration, like *{:phoenix*, *:router_dsl} *etc.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/04200023-5a21-4748-9843-b683b545349e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to