Unify formatting and linting
Ensures optimal formatting in addition to linting during manual deploys and during pre-commit actions.
This commit is contained in:
		@@ -4,11 +4,9 @@ pushd $( git rev-parse --show-toplevel ) &>/dev/null
 | 
			
		||||
 | 
			
		||||
ex=0
 | 
			
		||||
 | 
			
		||||
# Linting
 | 
			
		||||
echo "Linting..."
 | 
			
		||||
./lint
 | 
			
		||||
./prepare
 | 
			
		||||
if [[ $? -ne 0 ]]; then
 | 
			
		||||
    echo "Aborting commit due to linting errors."
 | 
			
		||||
    echo "Aborting commit due to formatting or linting errors."
 | 
			
		||||
    ex=1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -27,9 +27,9 @@ fi
 | 
			
		||||
HOSTS=( ${@} )
 | 
			
		||||
echo "> Deploying to host(s): ${HOSTS[@]}"
 | 
			
		||||
 | 
			
		||||
# Lint to prevent deploying bad code
 | 
			
		||||
echo -n "Linting code for errors... "
 | 
			
		||||
./lint || exit
 | 
			
		||||
# Prepare code
 | 
			
		||||
echo "Preparing code (format and lint)..."
 | 
			
		||||
./prepare || exit
 | 
			
		||||
 | 
			
		||||
# Build the packages
 | 
			
		||||
echo -n "Building packages... "
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								format
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								format
									
									
									
									
									
								
							@@ -5,6 +5,7 @@ if ! which black &>/dev/null; then
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "Formatting..."
 | 
			
		||||
black --safe --exclude api-daemon/migrations .
 | 
			
		||||
ret=$?
 | 
			
		||||
if [[ $ret -eq 0 ]]; then
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								lint
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								lint
									
									
									
									
									
								
							@@ -5,6 +5,7 @@ if ! which flake8 &>/dev/null; then
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "Linting..."
 | 
			
		||||
flake8
 | 
			
		||||
ret=$?
 | 
			
		||||
if [[ $ret -eq 0 ]]; then
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user