From b6c6fb7a411ef3bc90a0c7ed01144b17bbf1eb76 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 24 Jun 2020 00:35:12 +0100 Subject: [PATCH 1/3] Move flake8 to end. Don't exit script on failure --- scripts-dev/lint.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts-dev/lint.sh b/scripts-dev/lint.sh index 34c4854e1136..e05384324c9b 100755 --- a/scripts-dev/lint.sh +++ b/scripts-dev/lint.sh @@ -2,10 +2,8 @@ # # Runs linting scripts over the local Synapse checkout # isort - sorts import statements -# flake8 - lints and finds mistakes # black - opinionated code formatter - -set -e +# flake8 - lints and finds mistakes if [ $# -ge 1 ] then @@ -16,6 +14,6 @@ fi echo "Linting these locations: $files" isort -y -rc $files -flake8 $files python3 -m black $files ./scripts-dev/config-lint.sh +flake8 $files From c8c3b5b95589463f6e787ab6ed470d3b5e5a9fd6 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 24 Jun 2020 00:48:43 +0100 Subject: [PATCH 2/3] Changelog --- changelog.d/7738.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/7738.misc diff --git a/changelog.d/7738.misc b/changelog.d/7738.misc new file mode 100644 index 000000000000..f9b2d9bc5785 --- /dev/null +++ b/changelog.d/7738.misc @@ -0,0 +1 @@ +Prevent a failure in a linting tool blocking the others from being run. Move flake8 to the end as it takes the longest. \ No newline at end of file From b462806310a57cf707e6727bf0d090ec7987af34 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 24 Jun 2020 10:48:30 +0100 Subject: [PATCH 3/3] Add set -e back, update changelog --- changelog.d/7738.misc | 2 +- scripts-dev/lint.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.d/7738.misc b/changelog.d/7738.misc index f9b2d9bc5785..424ac15d66b4 100644 --- a/changelog.d/7738.misc +++ b/changelog.d/7738.misc @@ -1 +1 @@ -Prevent a failure in a linting tool blocking the others from being run. Move flake8 to the end as it takes the longest. \ No newline at end of file +Move `flake8` to the end of `scripts-dev/lint.sh` as it takes the longest and could cause the script to exit early. diff --git a/scripts-dev/lint.sh b/scripts-dev/lint.sh index e05384324c9b..6f1ba2293196 100755 --- a/scripts-dev/lint.sh +++ b/scripts-dev/lint.sh @@ -5,6 +5,8 @@ # black - opinionated code formatter # flake8 - lints and finds mistakes +set -e + if [ $# -ge 1 ] then files=$*