config-lint.sh 525 B

123456789101112131415
  1. #!/usr/bin/env bash
  2. # Find linting errors in Synapse's default config file.
  3. # Exits with 0 if there are no problems, or another code otherwise.
  4. # cd to the root of the repository
  5. cd `dirname $0`/..
  6. # Restore backup of sample config upon script exit
  7. trap "mv docs/sample_config.yaml.bak docs/sample_config.yaml" EXIT
  8. # Fix non-lowercase true/false values
  9. sed -i.bak -E "s/: +True/: true/g; s/: +False/: false/g;" docs/sample_config.yaml
  10. # Check if anything changed
  11. diff docs/sample_config.yaml docs/sample_config.yaml.bak