discussion and development of Emacs Snakemake mode
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Nicholas Knoblauch <knoblauch.nicholas@gene.com>
Cc: snakemake-mode@inbox.kyleam.com
Subject: [PATCH] mode: Add "container" and "envmodules" keywords
Date: Sun, 01 Nov 2020 15:36:51 -0500	[thread overview]
Message-ID: <87eelcak64.fsf@kyleam.com> (raw)
In-Reply-To: <CAG8C6oeB0CSQymy=GmrrFJEUvoq0TFUPv-k2SL0w6sTy4M+FNQ@mail.gmail.com>

Nicholas Knoblauch writes:

> Hi,
> It would be great if snakemake-mode could support `envmodules` and
> `containers` as top level commands as per
> https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html?highlight=envmodules#using-environment-modules
> and
> https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html?highlight=envmodules#running-jobs-in-containers

Sure, thanks for noticing that they're missing.  Based on the docs, my
understanding is that "envmodules" can only be used within a rule:

    rule bwa:
        envmodules:
            "bio/bwa/0.7.9"
        [...]

On the other hand, it looks like "container" can be used either within a
rule or at the top-level.  Is that correct?

> Also, maybe I should file a separate issue about this (maybe it isn't even
> a snakemake-mode question), but is there a way to force the "rule" line to
> never indent (even if I hit 'Tab' on that line)?
> I consistently run into whitespace issues with org-mode+snakemake-mode.

Hmm, not sure.  Starting a separate thread with a minimal reproducer
would be great.  Thanks.

-- >8 --
Subject: [PATCH] mode: Add "container" and "envmodules" keywords

Register "container" as both a field key and a top-level command
because an example of both is present in the Snakemake docs.

Reported-by: Nicholas Knoblauch <knoblauch.nicholas@gene.com>
---
 NEWS              | 5 +++--
 snakemake-mode.el | 3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index f046551..2743025 100644
--- a/NEWS
+++ b/NEWS
@@ -2,8 +2,9 @@ NEWS -- history of user-visible changes             -*- mode: org; -*-
 
 * master (unreleased)
 
-- Additional Snakemake keywords are now recognized: 'envvars' (new in
-  Snakemake v5.11.0) and 'cache' keyword (new in v5.12.0).
+- Additional Snakemake keywords are now recognized: 'envmodules' (new
+  in Snakemake v5.9.0), 'envvars' (new in v5.11.0), 'container' (new
+  in v5.11.0), and 'cache' (new in v5.12.0).
 
 * v1.7.0
 
diff --git a/snakemake-mode.el b/snakemake-mode.el
index 5f603ee..cc4d372 100644
--- a/snakemake-mode.el
+++ b/snakemake-mode.el
@@ -85,7 +85,9 @@ (eval-and-compile
                         (or "benchmark"
                             "cache"
                             "conda"
+                            "container"
                             "cwl"
+                            "envmodules"
                             "group"
                             "input"
                             "log"
@@ -110,6 +112,7 @@ (eval-and-compile
                         symbol-end))
       (sm-command . ,(rx symbol-start
                          (or "configfile"
+                             "container"
                              "envvars"
                              "include"
                              "localrules"

base-commit: 870e1f2379110e48c7f189832aa7663fcb0be836
-- 
2.28.0


  reply	other threads:[~2020-11-01 20:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-01 19:18 Add 'envmodules' and 'containers' to list of top level commands Nicholas Knoblauch
2020-11-01 20:36 ` Kyle Meyer [this message]
2020-11-01 21:04   ` [PATCH] mode: Add "container" and "envmodules" keywords Nicholas Knoblauch
2020-11-01 21:13     ` Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://git.kyleam.com/snakemake-mode

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eelcak64.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=knoblauch.nicholas@gene.com \
    --cc=snakemake-mode@inbox.kyleam.com \
    --subject='Re: [PATCH] mode: Add "container" and "envmodules" keywords' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.kyleam.com/snakemake-mode/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).