2019-07-10 09:03:18 -04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Runs linting scripts over the local Synapse checkout
|
|
|
|
# isort - sorts import statements
|
|
|
|
# black - opinionated code formatter
|
2020-06-25 12:58:55 -04:00
|
|
|
# flake8 - lints and finds mistakes
|
2019-07-10 09:03:18 -04:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-11-01 06:52:20 -04:00
|
|
|
if [ $# -ge 1 ]
|
|
|
|
then
|
|
|
|
files=$*
|
|
|
|
else
|
2020-07-20 16:43:49 -04:00
|
|
|
files="synapse tests scripts-dev scripts contrib synctl"
|
2019-11-01 06:52:20 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Linting these locations: $files"
|
2020-07-05 11:32:02 -04:00
|
|
|
isort $files
|
2019-11-01 06:52:20 -04:00
|
|
|
python3 -m black $files
|
2019-10-23 08:22:54 -04:00
|
|
|
./scripts-dev/config-lint.sh
|
2020-06-25 12:58:55 -04:00
|
|
|
flake8 $files
|