diff options
-rw-r--r-- | snakemake.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/snakemake.el b/snakemake.el index 5ac4762..8c3bf7e 100644 --- a/snakemake.el +++ b/snakemake.el @@ -246,6 +246,10 @@ The file list is determined by the output of (buffer-string) (error "Error finding file targets"))))))) +(defconst snakemake-invalid-target-re + (regexp-opt (list "MissingRuleException" + "RuleException"))) + (defun snakemake-check-target (target &optional directory) "Return non-nil if TARGET is a valid target for DIRECTORY's Snakefile." (snakemake-with-cache directory (target) @@ -254,8 +258,7 @@ The file list is determined by the output of (goto-char (point-min)) ;; Lean towards misclassifying targets as valid rather than ;; silently dropping valid targets as invalid. - (not (looking-at (regexp-opt (list "MissingRuleException" - "RuleException"))))))) + (not (looking-at snakemake-invalid-target-re))))) (declare-function org-element-context "org-element") (declare-function org-element-property "org-element") |