summary refs log tree commit diff
path: root/scripts-dev
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2019-10-23 13:22:54 +0100
committerGitHub <noreply@github.com>2019-10-23 13:22:54 +0100
commit409c62b27bca5df1c1f147e85ac1432376054d1c (patch)
tree3864979116fa6039220fb98a86b566d7d87e0b34 /scripts-dev
parentMerge pull request #6231 from matrix-org/erikj/refactor_stores (diff)
downloadsynapse-409c62b27bca5df1c1f147e85ac1432376054d1c.tar.xz
Add config linting script that checks for bool casing (#6203)
Add a linting script that enforces all boolean values in the default config be lowercase.

This has annoyed me for a while so I decided to fix it.
Diffstat (limited to 'scripts-dev')
-rwxr-xr-xscripts-dev/config-lint.sh9
-rwxr-xr-xscripts-dev/lint.sh1
2 files changed, 10 insertions, 0 deletions
diff --git a/scripts-dev/config-lint.sh b/scripts-dev/config-lint.sh
new file mode 100755
index 0000000000..677a854c85
--- /dev/null
+++ b/scripts-dev/config-lint.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Find linting errors in Synapse's default config file.
+# Exits with 0 if there are no problems, or another code otherwise.
+
+# Fix non-lowercase true/false values
+sed -i -E "s/: +True/: true/g; s/: +False/: false/g;" docs/sample_config.yaml
+
+# Check if anything changed
+git diff --exit-code docs/sample_config.yaml
diff --git a/scripts-dev/lint.sh b/scripts-dev/lint.sh
index ebb4d69f86..02a2ca39e5 100755
--- a/scripts-dev/lint.sh
+++ b/scripts-dev/lint.sh
@@ -10,3 +10,4 @@ set -e
 isort -y -rc synapse tests scripts-dev scripts
 flake8 synapse tests
 python3 -m black synapse tests scripts-dev scripts
+./scripts-dev/config-lint.sh