Skip to content

Commit

Permalink
run_recipe: add the ability to run yamllint over a recipe
Browse files Browse the repository at this point in the history
This is a very rudimentary implementation and just runs yamllint in
a subprocess for a nicely colored and formatted output.

Right now this outputs a lot of indentation errors in the example
recipes, none of which are of consequence to the correctness of the
resulting data produced by the framework.
  • Loading branch information
hagau committed Sep 20, 2024
1 parent d00dc34 commit 9827509
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions run_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import shutil
import argparse
import subprocess
import traceback
import threading

Expand Down Expand Up @@ -365,6 +366,7 @@ def parse_arguments(arguments):

parser.add_argument('--dump-recipe', action='store_true', default=False, help='Dump the loaded recipe; useful for finding errors in the recipe')
parser.add_argument('--dump-recipe-only', action='store_true', default=False, help='Dump the loaded recipe and exit; useful for finding errors in the recipe')
parser.add_argument('--lint-recipe', action='store_true', default=False, help='Run yamllint over the specified recipe; useful for finding errors in the recipe')

parser.add_argument('--debug', action='store_true', default=False, help='Enable debug mode. If an exception is encountered, drop into an ipdb debugger session')

Expand Down Expand Up @@ -592,6 +594,11 @@ def main():

logd(f'{options=}')

if options.lint_recipe:
# Just run yamllint in a subprocess for now. This also provides a nicely colored output.
subprocess.run(['yamllint', options.recipe])
exit()

setup_pandas()

client = setup_dask(options)
Expand Down

0 comments on commit 9827509

Please sign in to comment.