slamhound
slamhound copied to clipboard
Slamhound only works from the root directory
Slamhound only seems to work from the root directory of a project with a fully qualified file name. So consider this example:
~/scratch $ lein new slamhound-test
Generating a project called slamhound-test based on the 'default' template.
To see other templates (app, lein plugin, etc), try `lein help new`.
~/scratch $ cd slamhound-test/src/slamhound_test/
~/scratch/slamhound-test/src/slamhound_test $ ls
core.clj
~/scratch/slamhound-test/src/slamhound_test $ lein slamhound core.clj
~/scratch/slamhound-test/src/slamhound_test $ cd ..
~/scratch/slamhound-test/src $ cd ..
~/scratch/slamhound-test $ lein slamhound src/slamhound_test/core.clj
The first use of slamhound does nothing at all (although it appears to exit normally). I think that it should either update the ns form, and at least crash when used like so.
This is due to Leiningen changing directories to the project root before launching project code. However, it sets the leiningien.original.pwd property to the original directory, so we should look for relative path names based on that property if it's present.