Permalink
Browse files

Add a command linter.

 - Just verifies there is exactly one command tag.
  • Loading branch information...
jmchilton committed Feb 15, 2015
1 parent 411a8da commit b8d90abab8bf53ae2e7cca4317223c01af9ab68c
Showing with 18 additions and 0 deletions.
  1. +18 −0 planemo_ext/galaxy/tools/linters/command.py
@@ -0,0 +1,18 @@


def lint_command(tool_xml, lint_ctx):
root = tool_xml.getroot()
commands = root.findall("command")
if len(commands) > 1:
lint_ctx.error("More than one command tag found, behavior undefined.")
return

if len(commands) == 0:
lint_ctx.error("No command tag found, must specify a command template to execute.")
return

command = commands[0]
if "TODO" in command:
lint_ctx.warn("Command template contains TODO text.")

lint_ctx.info("Tool contains a command.")

0 comments on commit b8d90ab

Please sign in to comment.