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