summaryrefslogtreecommitdiff
path: root/snakemake.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-04-17 18:27:15 -0400
committerKyle Meyer <kyle@kyleam.com>2016-04-17 19:05:03 -0400
commit4b019984497913a770cf9d29f56f64e8bb5e0673 (patch)
treeffea7e430b791ab43d76f63227ff1583da6116a3 /snakemake.el
parent2682860608862b99adbe830c289efe9897700fc1 (diff)
downloadsnakemake-mode-4b019984497913a770cf9d29f56f64e8bb5e0673.tar.gz
Filter out anonymous rules from rule lists
Diffstat (limited to 'snakemake.el')
-rw-r--r--snakemake.el26
1 files changed, 15 insertions, 11 deletions
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.