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

Remove empty sections after last setting is removed #199

Merged
merged 1 commit into from
Mar 1, 2016

Conversation

hunner
Copy link
Contributor

@hunner hunner commented Feb 29, 2016

Empty sections hanging around are not useful, so if the last line in a
section is removed then remove the section. If the section still has
comments, then just leave it be.

This does not add the ability to remove sections that do not have
settings to begin with; only allows cleaning a file as puppet makes
changes to it.

uncom = ment

-nonstandard-
shoes = purple
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved these lines up to verify that the [section:sub] is not affected by removing a section.

Empty sections hanging around are not useful, so if the last line in a
section is removed then remove the section. If the section still has
comments, then just leave it be.

This does not add the ability to remove sections that do not have
settings to begin with; only allows cleaning a file as puppet makes
changes to it.
[section:sub]
subby=bar
#another comment
; yet another comment

-nonstandard-
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is now being removed, as it is empty after the setting is removed.

@EmilienM
Copy link

EmilienM commented Mar 1, 2016

👍 thanks for this useful feature

@gfidente
Copy link

gfidente commented Mar 1, 2016

thanks! this will be very useful for https://review.openstack.org/#/c/280351/8/manifests/mon.pp

@bmjen
Copy link
Contributor

bmjen commented Mar 1, 2016

👍

bmjen added a commit that referenced this pull request Mar 1, 2016
Remove empty sections after last setting is removed
@bmjen bmjen merged commit af9de61 into puppetlabs:master Mar 1, 2016
@EmilienM
Copy link

EmilienM commented Mar 1, 2016

@bmjen thanks a lot for your eyes on it!
May I ask if module team plans to do a release soon? If you have a release date, I'm curious to know when.

Thanks a lot for your help

@hunner hunner deleted the remove_empty_section branch March 3, 2016 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants