Browse Source

Add a linting script (#5627)

Add a dev script to cover all the different linting steps.
Andrew Morgan 4 years ago
parent
commit
3dd61d12cd
2 changed files with 13 additions and 0 deletions
  1. 1 0
      changelog.d/5627.misc
  2. 12 0
      scripts-dev/lint.sh

+ 1 - 0
changelog.d/5627.misc

@@ -0,0 +1 @@
+Add `lint.sh` to the scripts-dev folder which will run all linting steps required by CI.

+ 12 - 0
scripts-dev/lint.sh

@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Runs linting scripts over the local Synapse checkout
+# isort - sorts import statements
+# flake8 - lints and finds mistakes
+# black - opinionated code formatter
+
+set -e
+
+isort -y -rc synapse tests scripts-dev scripts
+flake8 synapse tests
+python3 -m black synapse tests scripts-dev scripts