Repository: conda-forge/conda-smithy

Issue:
Autogenerated README.md missing final newline
## The Problem

As I've confirmed is the case on multiple repos here, including our own ``spyder-feedstock`` and ``spyder-kernels-feedstock`` as well as two arbitrary conda-forge repos I checked conda-forge, the last line in README.md lacks a terminating newline (LF/``x0D``), and is thus ill-formed. I'd be happy to submit a PR to fix it since I imagine it is probably pretty trivial, if someone more knowlegable than me can let me know how to approach it. 

## Proposed Solutions

A naive hack would seem to be just writing an additional ``\n`` [here](https://github.com/conda-forge/conda-smithy/blob/855f23bb96efb1cbdbdc5e60dfb9bbdd3e142d31/conda_smithy/configure_feedstock.py#L718), but editing the [template ](https://github.com/conda-forge/conda-smithy/blob/master/conda_smithy/templates/README.md.tmpl) would seem to make far more sense. However, the template *has* a trailing newline and hasn't been edited in a while, so not sure what's going on—is it not writing the last one; is it getting stripped, or what?

Thanks!


Discussion:
Sure, feel free to.

Rendering stuff with Jinja often results in the trailing newline getting stripped. So one ends up needing to add `{# #}` or a similar trick to force the newline to stick. We try to keep this sort of stuff in, but managing whitespace in Jinja is a bit subtle and it often gets missed in review unless people test it out manually.

We probably could use some unit tests to catch this sort of issue if you have any interest.

Resolving patch:
diff --git a/conda_smithy/vendored/__init__.py b/conda_smithy/vendored/__init__.py
--- a/conda_smithy/vendored/__init__.py
+++ b/conda_smithy/vendored/__init__.py
@@ -0,0 +1 @@
+


Test patch:
diff --git a/tests/recipes/click-test-feedstock/README.md b/tests/recipes/click-test-feedstock/README.md
--- a/tests/recipes/click-test-feedstock/README.md
+++ b/tests/recipes/click-test-feedstock/README.md
@@ -103,4 +103,4 @@ In order to produce a uniquely identifiable distribution:
    the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string).
  * If the version of a package **is** being increased, please remember to return
    the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string)
-   back to 0.
\ No newline at end of file
+   back to 0.
diff --git a/tests/test_configure_feedstock.py b/tests/test_configure_feedstock.py
--- a/tests/test_configure_feedstock.py
+++ b/tests/test_configure_feedstock.py
@@ -222,3 +222,14 @@ def test_render_windows_with_skipped_python(python_skipped_recipe, jinja_env):
     matrix_dir = os.path.join(python_skipped_recipe.recipe, '.ci_support')
     # matrix has 2.7, 3.5, 3.6, but 3.6 is skipped.  Should be 2 entries.
     assert len(os.listdir(matrix_dir)) == 2
+
+
+def test_readme_has_terminating_newline(noarch_recipe, jinja_env):
+    cnfgr_fdstk.render_README(jinja_env=jinja_env,
+                              forge_config=noarch_recipe.config,
+                              forge_dir=noarch_recipe.recipe)
+    readme_path = os.path.join(noarch_recipe.recipe, 'README.md')
+    assert os.path.exists(readme_path)
+    with open(readme_path, 'rb') as readme_file:
+        readme_file.seek(-1, os.SEEK_END)
+        assert readme_file.read() == b'\n'