erplibre/script/maintenance/autopep8.sh

15 lines
384 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
Red='\033[0;31m' # Red
Color_Off='\033[0m' # Text Reset
# This will format all python file
# argument 1: directory or file to format
NPROC=$(nproc)
source ./.venv.erplibre/bin/activate
2021-06-27 00:22:22 -04:00
oca-autopep8 -j ${NPROC} --max-line-length 79 -ari $@
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo -e "${Red}Error${Color_Off} oca-autopep8 format"
2021-06-27 00:22:22 -04:00
exit 1
fi