getpelican/pelican — pull request #1224 by leplatrem (2014-01-09 14:22:32+00:00)
Title: Exit code should not be successful on restructuredtext errors

Currently, if there is a restructured syntax error, the exit code is still 0.

$ make publish
...
.../content/article.rst:34: (ERROR/3) Unexpected indentation.
.../content/article.rst:36: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
Done: Processed 60 articles and 1 pages in 3.03 seconds.

$ echo $?
0

I [use Travis to build the blog](http://blog.mathieu-leplatre.info/publish-your-pelican-blog-on-github-pages-via-travis-ci.html). It would be great if I could publish the output only if there is no rST error at all :)

# .travis.yml
script:
- make publish
after_sucess:
- make github

This change allows to fail and exit loudly.

$ make publish
...
.../content/article.rst:34: (ERROR/3) Unexpected indentation.
.../content/article.rst:36: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
make: *** [publish] Erreur 13

$ echo $?
2