rodjek/puppet-lint — pull request #226 by rodjek (2013-09-24 09:48:36+00:00)
Title: Refactor check plugins to have slightly less awful magic

The old way of defining check plugins did some horrible hacks to take the code block specified with `check 'foo' do ... end` and add it to the `PuppetLint::Checks` as a new method at runtime in order to avoid having to parse the manifest multiple times (the tokenised manifest was stored as an instance variable in `PuppetLint::Checks`.

With this refactor, we now store the tokenised manifest in a singleton class (`PuppetLint::Data`) and all checks live in their own class, allowing check authors to define arbitrary helpers and making adding `--fix` support to a check a simple matter of defining a `fix` method in your check class.