From 8477f4fde98099c51e5c7b555eaa05a6c1771344 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Mon, 31 Jul 2017 15:12:23 -0400 Subject: [PATCH] add wrapper for yamllint We don't need to run the linter over every single old deliverable file every time. Just check the "modern" series that are most likely to be open, and the _independent projects. Change-Id: I5207600838c37b241d0ab178080be75a8f31a725 Signed-off-by: Doug Hellmann --- tools/run_yamllint.sh | 13 +++++++++++++ tox.ini | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 tools/run_yamllint.sh diff --git a/tools/run_yamllint.sh b/tools/run_yamllint.sh new file mode 100755 index 0000000000..7245d16527 --- /dev/null +++ b/tools/run_yamllint.sh @@ -0,0 +1,13 @@ +#!/bin/bash -x +# +# Wrapper around yamllint that only looks at recent branches to avoid +# us having to reformat really old deliverable files. + +bindir=$(dirname $0) +topdir=$(dirname $bindir) + +# determine the 3 most recent series, since those are most likely to +# still be open +series=$(ls -1d deliverables/* | tail -n 3) + +yamllint -f parsable -c $topdir/yamllint.yml $series deliverables/_independent diff --git a/tox.ini b/tox.ini index 73b6cc083d..81d3fe8cbb 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ commands = deps = yamllint==1.4.1 commands = - yamllint -f parsable -c {toxinidir}/yamllint.yml deliverables + {toxinidir}/tools/run_yamllint.sh validate-request {posargs} [testenv:list-changes]