pub mod analysis;
pub mod auth;
pub mod cli;
pub mod config;
pub mod diff;
pub mod docs;
pub mod files;
pub mod http;
pub mod languages;
pub mod llm;
pub mod text;
#[cfg(test)]
pub(crate) mod test_support;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Exit {
Clean,
FoundIssues,
Unanalyzed,
}
impl Exit {
pub const fn code(self) -> u8 {
match self {
Exit::Clean => 0,
Exit::FoundIssues => 1,
Exit::Unanalyzed => 2,
}
}
}
impl From<Exit> for std::process::ExitCode {
fn from(exit: Exit) -> Self {
std::process::ExitCode::from(exit.code())
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn exit_codes_are_stable() {
assert_eq!(Exit::Clean.code(), 0);
assert_eq!(Exit::FoundIssues.code(), 1);
assert_eq!(Exit::Unanalyzed.code(), 2);
}
}