2019-07-10 14:03:18 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Runs linting scripts over the local Synapse checkout
|
|
|
|
# isort - sorts import statements
|
|
|
|
# black - opinionated code formatter
|
2020-06-25 17:58:55 +01:00
|
|
|
# flake8 - lints and finds mistakes
|
2019-07-10 14:03:18 +01:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-11-01 03:52:20 -07: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 03:52:20 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Linting these locations: $files"
|
2020-07-05 16:32:02 +01:00
|
|
|
isort $files
|
2019-11-01 03:52:20 -07:00
|
|
|
python3 -m black $files
|
2019-10-23 13:22:54 +01:00
|
|
|
./scripts-dev/config-lint.sh
|
2020-06-25 17:58:55 +01:00
|
|
|
flake8 $files
|