2019-10-16 04:43:28 -04:00
|
|
|
#!/bin/sh -l
|
|
|
|
|
2019-12-17 06:50:34 -05:00
|
|
|
echo "======================"
|
|
|
|
echo "= Linting YAML files ="
|
|
|
|
echo "======================"
|
|
|
|
|
2020-01-08 02:23:41 -05:00
|
|
|
# Use the current directory by default
|
|
|
|
export INPUT_FILE_OR_DIR=${INPUT_FILE_OR_DIR:-.}
|
2019-12-17 08:15:23 -05:00
|
|
|
|
|
|
|
STRICT=""
|
|
|
|
if [ "$INPUT_STRICT" == "true" ]; then
|
2019-10-16 04:43:28 -04:00
|
|
|
STRICT="-s"
|
|
|
|
fi
|
|
|
|
|
2019-10-16 04:47:45 -04:00
|
|
|
if [ ! -z "$INPUT_CONFIG_FILE" ]; then
|
|
|
|
CONFIG_FILE="-c $INPUT_CONFIG_FILE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -z "$INPUT_CONFIG_DATA" ]; then
|
|
|
|
CONFIG_DATA="-d $INPUT_CONFIG_DATA"
|
|
|
|
fi
|
|
|
|
|
2020-01-08 02:23:41 -05:00
|
|
|
yamllint $CONFIG_FILE $CONFIG_DATA -f $INPUT_FORMAT $STRICT $INPUT_FILE_OR_DIR
|