#!/bin/bash

# This file runs flake8 for compatibility's sake. As soon as we move off python 3.6, this should be changed to use ruff.

CR="
"
pycheck_dirs=( "cloudinit/" "tests/" "tools/"  "setup.py" )

set -f
if [ $# -eq 0 ]; then
   files=( "${pycheck_dirs[@]}" )
else
   files=( "$@" )
fi

cmd=( "python3" -m "flake8" "${files[@]}" )

echo "Running: " "${cmd[@]}" 1>&2
exec "${cmd[@]}"
