Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
YAML linter
<?php
<<<CONFIG
packages:
- "symfony/yaml: ~2.3"
CONFIG;
use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Parser;
$content = file_get_contents($argv[1]);
$parser = new Parser();
try {
$parser->parse($content);
} catch (ParseException $e) {
echo $e->getMessage();
return 1;
}
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.