Dan Lipsitt avatar Dan Lipsitt committed 403e586

Make customizable with defcustom.

Comments (0)

Files changed (1)

 ;; In your emacs config:
 ;;
 ;; (require 'nose)
-;; ; next line only for people with non-eco non-global test runners
-;; ; (add-to-list 'nose-project-names "my/crazy/runner")
-
-;; Note that if your global nose isn't called "nosetests", then you'll want to
-;; redefine nose-global-name to be the command that should be used.
-
-;; By default, the root of a project is found by looking for any of the files
-;; 'setup.py', '.hg' and '.git'. You can add files to check for to the file
-;; list:
-;;
-;; ; (add-to-list 'nose-project-root-files "something")
-
-;; or you can change the project root test to detect in some other way
-;; whether a directory is the project root:
-;;
-;; ; (setq nose-project-root-test (lambda (dirname) (equal dirname "foo")))
-
-;; If you want dots as output, rather than the verbose output:
-;; (defvar nose-use-verbose nil) ; default is t
+;; Run `customize-group nose' to configure.
 
 ;; Probably also want some keybindings:
 ;; (add-hook 'python-mode-hook
 
 (require 'cl) ;; for "reduce"
 
-(defvar nose-project-names '("eco/bin/test"))
-(defvar nose-project-root-files '("setup.py" ".hg" ".git"))
-(defvar nose-project-root-test 'nose-project-root)
-(defvar nose-global-name "nosetests")
-(defvar nose-use-verbose t)
+(defgroup nose nil
+  "A tool for Python unit testing."
+  :group 'python)
+
+(defcustom nose-project-names nil
+  "Location of non-global test runners."
+  :type '(repeat directory)
+  :group 'nose)
+
+(defcustom nose-project-root-files '("setup.py" ".hg" ".git")
+  "The presence of one of these files indicates the project root directory.
+You may choose to use a custom function instead by setting
+`nose-project-root-test'"
+  :type '(repeat string)
+  :group 'nose)
+
+(defcustom nose-project-root-test 'nose-project-root
+  "This function is used to detect the project root.
+It can be a lambda expression. For example:
+  '(lambda (dirname) (equal dirname \"foo\"))"
+  :type '(function)
+  :group 'nose)
+
+(defcustom nose-global-name "nosetests"
+  "Name of the nose shell command."
+  :type '(string)
+  :group 'nose)
+
+(defcustom nose-use-verbose t
+  "Only dots will be output if this variable is nil."
+  :type '(boolean)
+  :group 'nose)
 
 (defun run-nose (&optional tests debug failed)
   "run nosetests"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.