rebar3_format
rebar3_format copied to clipboard
Support for sys.config.src
Is there any support for the config.src format? When I run the formatter against sys.config.src it puts it the whole config onto a single line - is this format not supported, or do I need to tweak my config?
🤔 Can you show me a sample config.src file? I was not aware of that kind of file existence at all.
I believe it is a Rebar3/Relx feature:
Starting with Erlang/OTP 21 and rebar3 3.6.0 the configuration options sys_config_src and vm_args_src are available for explicitly including templates that will be rendered at runtime, substituting variables defined as ${VARIABLE} with their equivalent value in the shell environment.
http://rebar3.org/docs/deployment/releases/#environment-variable-replacement
I'm not sure how easy it would be to support, before substitution the files are not valid terms
Yeah… Not easy at all.
Yeah maybe this is beyond the scope of a formatter, it's impossible to know even what the variables will expand to anyway
It's not beyond the scope of the formatter (it can format those files without expanding them) but it's beyond the current capabilities of OTP's erl_syntax
and therefore handling it will require some serious adjustments to ktn_dodger
.