shadowplay 0.16.3

Utility for checking puppet syntax, a puppet manifest linter, a pretty printer, and a utility for exploring the Hiera.
Documentation
mod parser;

use std::collections::HashSet;

#[derive(Debug, PartialEq)]
pub struct Template {
    pub referenced_variables: HashSet<String>,
}

impl Template {
    pub fn read(path: &std::path::Path) -> Option<Self> {
        let file_content = match std::fs::read_to_string(path) {
            Err(_err) => {
                return None;
            }
            Ok(v) => v,
        };

        parser::parse_toplevel(&file_content)
            .ok()
            .map(|(_, template)| template)
    }
}