aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--snakemake-test.el4
-rw-r--r--snakemake.el26
2 files changed, 17 insertions, 13 deletions
diff --git a/snakemake-test.el b/snakemake-test.el
index 274ce56..3bac276 100644
--- a/snakemake-test.el
+++ b/snakemake-test.el
@@ -715,13 +715,13 @@ rule abc:
(ert-deftest snakemake-test-rule-targets ()
(should
- (equal '("aa" "bb" "dd_subdir" "5")
+ (equal '("aa" "bb" "dd_subdir")
(snakemake-with-temp-dir
(snakemake-rule-targets)))))
(ert-deftest snakemake-test-all-rules ()
(should
- (equal '("aa" "bb" "cc_wildcards" "dd_subdir" "5")
+ (equal '("aa" "bb" "cc_wildcards" "dd_subdir")
(snakemake-with-temp-dir
(snakemake-all-rules)))))
diff --git a/snakemake.el b/snakemake.el
index cc6bc3f..fa200bd 100644
--- a/snakemake.el
+++ b/snakemake.el
@@ -211,21 +211,25 @@ with DIRECTORY and the Snakefile's modification time."
(defun snakemake-all-rules (&optional directory)
"Return list of rules for DIRECTORY's Snakefile."
(snakemake-with-cache directory ("all-rules")
- (split-string
- (with-temp-buffer
- (if (= 0 (snakemake-insert-output "--nocolor" "--list"))
- (buffer-string)
- (error "Error finding rules"))))))
+ (cl-remove-if
+ (lambda (x) (string-match-p "\\`[0-9]+\\'" x))
+ (split-string
+ (with-temp-buffer
+ (if (= 0 (snakemake-insert-output "--nocolor" "--list"))
+ (buffer-string)
+ (error "Error finding rules")))))))
(defun snakemake-rule-targets (&optional directory)
"Return list of target rules for DIRECTORY's Snakefile."
(snakemake-with-cache directory ("target-rules")
- (split-string
- (with-temp-buffer
- (if (= 0 (snakemake-insert-output
- "--nocolor" "--list-target-rules"))
- (buffer-string)
- (error "Error finding rule targets"))))))
+ (cl-remove-if
+ (lambda (x) (string-match-p "\\`[0-9]+\\'" x))
+ (split-string
+ (with-temp-buffer
+ (if (= 0 (snakemake-insert-output
+ "--nocolor" "--list-target-rules"))
+ (buffer-string)
+ (error "Error finding rule targets")))))))
(defun snakemake-file-targets (&optional directory)
"Return list of output files for DIRECTORY's Snakefile.