shuck-linter 0.0.40

Lint rule engine and checker for shell scripts
Documentation
use crate::{Checker, Rule, Violation};

use super::source_common::source_command_spans_in_sh;

pub struct SourceBuiltinInSh;

impl Violation for SourceBuiltinInSh {
    fn rule() -> Rule {
        Rule::SourceBuiltinInSh
    }

    fn message(&self) -> String {
        "`source` is not portable in `sh` scripts".to_owned()
    }
}

pub fn source_builtin_in_sh(checker: &mut Checker) {
    let spans = source_command_spans_in_sh(checker);
    checker.report_all(spans, || SourceBuiltinInSh);
}