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