bbatsov/projectile — pull request #249 by byels (2014-01-24 01:09:35+00:00)
Title: Make projectile test file prefix/suffix functions "customizable"

Hi!
I've been playing with `projectile` for a few days now and it's been a huge boost to my workflow.
I have however hit a snag with the test-file -> implementation-file toggling feature, namely that my company's `unittest` test files use the `*_test.py` naming convention, rather than the `test_*.py` convention currently supported by `projectile`.
It would be great if the functions supplying prefixes/suffixes for test files were customizable; here's one implementation of that. I've deliberately kept the existing prefix/suffix functions as they are (so as not to mess up users who've worked around this already by overriding them), just wrapped them with `customize` aliases.

Here's an example of user then customizing `projectile` to their test setup:

```lisp
(defun default-projectile-prefix-unless-django (project-type)
(when (not (eq project-type 'django))
(projectile-test-prefix project-type)))

(defun default-projectile-suffix-unless-django (project-type)
(if (eq project-type 'django)
"_test"
(projectile-test-suffix project-type)))

(custom-set-variables
'(projectile-test-prefix-function 'default-projectile-prefix-unless-django)
'(projectile-test-suffix-function 'default-projectile-suffix-unless-django))
```

I've run the `cask` tests as well as `checkdoc` and things look good.