technomancy/leiningen — pull request #1461 by cpmcdaniel (2014-03-01 18:59:14+00:00)
Title: Fix for #1458: clean-targets sanity checks.

This patch will cause _lein clean_ to fail if the _:clean-targets_ value contains locations which are not within the project root, contain one of the source paths (including resources, doc, test, src), or the project.clj file itself.

Note: this solution does not check whether the clean-target exists. If someone tries to use "../some-non-existent-path", the _lein clean_ task will throw an error even if that path does not actually exist. I believe this behavior is acceptable. Using this approach also allowed me to create safer unit tests.