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 leading whitespace from README template #213

Merged
merged 2 commits into from
Apr 26, 2019

Conversation

montaguethomas
Copy link
Contributor

When generated, the README.md will have a leading newline.

@@ -1,4 +1,4 @@
<% name = @configs['module_metadata']['name'].split('-').last rescue '[modulename]' %>
<%- name = @configs['module_metadata']['name'].split('-').last rescue '[modulename]' -%>
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe you want <%-Just -%> at the end to remove newlines.

Don't see why we want this line at all though since we have # name below it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason for the PR is because without it, you end up with a rendered file with a single blank line starting the file like this:


# Template

Welcome to your new module...

Agreed the leading <%- isn't required, it's a style I personally use for all code tags in erb templates to prevent superfluous whitespace from being rendered should the block be indented.

@rodjek rodjek merged commit 7f1955b into puppetlabs:master Apr 26, 2019
@montaguethomas montaguethomas deleted the patch-1 branch April 30, 2019 00:48
@scotje scotje added this to the PDK 1.11.0.0 milestone Jun 25, 2019
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

Successfully merging this pull request may close these issues.

4 participants