ptarjan/heroku-buildpack-hhvm — pull request #5 by ClaudiuC (2013-08-29 21:13:10+00:00)
Title: Lint config file, make sure we don't push broken configs

This diff adds a linter for config files. Included is a test config - I'll follow up with proper test and pre-commit hooks to make sure we don't break it.

Tested locally with the test file and with good and bad config files on Heroku.

Good file (config at the bottom of http://www.hhvm.com/blog/?p=113, unmodified):
```
-----> Fetching custom git buildpack... done
-----> PHP (HHVM) app detected
-----> Vendoring HHVM
-----> /app/tmp/repo.git/.cache/hhvm exists, not downloading
-----> Vendoring binaries into slug
-----> Sourcing config.hdf
-----> Found custom config.hdf, linting
-----> Aborting - can't push bad config
-----> Discovering process types
Procfile declares types -> (none)
Default types for PHP (HHVM) -> web

-----> Compiled slug size: 21.2MB
-----> Launching... done, v17
```

Bad file:
```
-----> Fetching custom git buildpack... done
-----> PHP (HHVM) app detected
-----> Vendoring HHVM
-----> /app/tmp/repo.git/.cache/hhvm exists, not downloading
-----> Vendoring binaries into slug
-----> Sourcing config.hdf
-----> Found custom config.hdf, linting
-----> Unexpected node name in on line 9
Foo Bar {
-----> Bad config key-value pair in on line 15
File = /var/log/hhvm/access.log = illegal
-----> Bad config key-value pair in on line 26
NoValue
-----> Aborting - can't push bad config

! Push rejected, failed to compile PHP (HHVM) app
```

With:

```
Server {
DefaultDocument = index2.php
}

Eval {
Jit = true
}

Foo Bar {
Level = Error
UseLogFile = true
File = /var/log/hhvm/error.log
Access {
* {
File = /var/log/hhvm/access.log = illegal
Format = %h %l %u %t \"%r\" %>s %b
}
}
}

VirtualHost {
* {
Pattern = .*
RewriteRules {
dirindex {
NoValue
pattern = ^/(.*)/$
to = $1/index.php
qsa = true
}
}
}
}

```