keras/shell/lint.sh
Haifeng Jin f3c5262cd9 Use GitHub Action to lint each pull request.
PiperOrigin-RevId: 452114390
2022-05-31 12:36:58 -07:00

24 lines
474 B
Bash

#!/bin/bash
isort --check --sl -c keras
if ! [ $? -eq 0 ]
then
echo "Please run \"sh shell/format.sh\" to format the code."
exit 1
fi
echo "no issues with isort"
flake8 keras
if ! [ $? -eq 0 ]
then
echo "Please fix the code style issue."
exit 1
fi
echo "no issues with flake8"
black --check --line-length 80 keras
if ! [ $? -eq 0 ]
then
echo "Please run \"sh shell/format.sh\" to format the code."
exit 1
fi
echo "no issues with black"
echo "linting success!"