igniter icon indicating copy to clipboard operation
igniter copied to clipboard

Support commented out config lines

Open juanazam opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

Enhance Igniter.Project.configure/6 to allow passing an option which generates the config, but as a commented line.

This is useful for cases were a config line wants to be added as a hint.

Describe the solution you'd like

There is an exisiting implementation for this here: https://github.com/mimiquate/tower_email/pull/63

Describe alternatives you've considered

No response

Additional context

No response

juanazam avatar Jul 11 '25 18:07 juanazam

This sounds great to me! What I would suggest is that we can make Igniter.Code.Common.add_code support a commented?: true option, along with a leading_comments and/or trailing_comments option? The important thing about doing it this way is that, for example, if something is already configured we'd want to insert it into the appropriate place but w/ the key configured.

i.e

config :foo, :bar, baz: true

If you wanted to configure [:foo, :bar, :bat] to true, but commented, you'd want something like:

config :foo, :bar, 
  baz: true
#  bat: true

I'm honestly not sure how successful that effort would be but it would be good to try. If it doesn't work out, then we can just add the line but not merged, and comment it out (like your impl does).

zachdaniel avatar Jul 11 '25 21:07 zachdaniel

Ash fellow here! I would love to give this one a go if no one is working on this one yet.

Crobe182 avatar Oct 22 '26 16:10 Crobe182

I don't think so, just make sure to check that the new options added since this issue was posted don't cover it. I think we'd want to potentially support this in the functions that support adding multiple configs at a time as well.

zachdaniel avatar Oct 22 '26 20:10 zachdaniel