Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for sys.config.src #245

Open
afhole opened this issue Apr 28, 2021 · 6 comments
Open

Support for sys.config.src #245

afhole opened this issue Apr 28, 2021 · 6 comments
Milestone

Comments

@afhole
Copy link

afhole commented Apr 28, 2021

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?

@elbrujohalcon
Copy link
Collaborator

🤔 Can you show me a sample config.src file? I was not aware of that kind of file existence at all.

@elbrujohalcon elbrujohalcon added this to the 1.1.0 milestone Apr 28, 2021
@afhole
Copy link
Author

afhole commented Apr 28, 2021

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

@afhole
Copy link
Author

afhole commented Apr 28, 2021

I'm not sure how easy it would be to support, before substitution the files are not valid terms

@elbrujohalcon
Copy link
Collaborator

Yeah… Not easy at all.

@afhole
Copy link
Author

afhole commented Apr 28, 2021

Yeah maybe this is beyond the scope of a formatter, it's impossible to know even what the variables will expand to anyway

@elbrujohalcon
Copy link
Collaborator

elbrujohalcon commented Apr 28, 2021

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.

@elbrujohalcon elbrujohalcon modified the milestones: 1.1.0, 1.1.1 Apr 11, 2022
@elbrujohalcon elbrujohalcon modified the milestones: 1.1.1, 1.1.2 May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants