architecture_component!(CommandLintContract);
use crate::command_lint::command::InterceptedCommand;
use crate::command_lint::vcs::JjClient;
use crate::diagnostic::Diagnostic;
use crate::rule_declaration::Declaration;
#[derive(Clone, Copy)]
pub struct CommandRule {
pub declaration: Declaration,
pub(super) check: fn(&Self, &InterceptedCommand, &dyn JjClient) -> Vec<Diagnostic>,
}
impl CommandRule {
#[must_use]
pub(crate) fn check_command(
&self,
cmd: &InterceptedCommand,
jj_client: &dyn JjClient,
) -> Vec<Diagnostic> {
(self.check)(self, cmd, jj_client)
}
}