conda_smithy/vendored/__init__.py
conda_smithy/vendored/__init__.py
diff --git a/.gitignore b/.gitignore
index 4f4b3b35c..5761ca997 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,9 @@ dist/
 
 # Rever
 rever/
+
+# Notepad++ files
+nppBackup/
+
+# Pytest dirs/files
+.pytest_cache/
diff --git a/conda_smithy/templates/README.md.tmpl b/conda_smithy/templates/README.md.tmpl
index 662b86f9e..2cfd535bb 100644
--- a/conda_smithy/templates/README.md.tmpl
+++ b/conda_smithy/templates/README.md.tmpl
@@ -136,3 +136,4 @@ In order to produce a uniquely identifiable distribution:
  * 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.
+{# this comment ensures a trailing newline #}
diff --git a/conda_smithy/vendored/__init__.py b/conda_smithy/vendored/__init__.py
index e69de29bb..8b1378917 100644
--- a/conda_smithy/vendored/__init__.py
+++ b/conda_smithy/vendored/__init__.py
@@ -0,0 +1 @@
+
diff --git a/news/fix-no-newline.rst b/news/fix-no-newline.rst
new file mode 100644
index 000000000..dbd5462fc
--- /dev/null
+++ b/news/fix-no-newline.rst
@@ -0,0 +1,3 @@
+**Fixed:**
+
+* Fix missing newline in last line of generated readmes and add unit test for it (#864)
diff --git a/tests/recipes/click-test-feedstock/README.md b/tests/recipes/click-test-feedstock/README.md
index 3b8f66040..37a014e57 100644
--- 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
index 1fd6e41d1..e98233b10 100644
--- 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'

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!
