use std::path::PathBuf;
use skif_config::ConfigError;
use skif_lint::{LintError, RegistryError};
use skif_workspace::WorkspaceError;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error(transparent)]
Config(#[from] ConfigError),
#[error(transparent)]
Workspace(#[from] WorkspaceError),
#[error(transparent)]
Registry(#[from] RegistryError),
#[error(transparent)]
Lint(#[from] LintError),
#[error("no workspace found at or above {}", .0.display())]
NoWorkspace(PathBuf),
#[error("{} is relative; pass an absolute path", .0.display())]
RelativePath(PathBuf),
#[error("unknown rule \"{0}\"")]
UnknownRule(String),
#[error("cannot build the thread pool: {0}")]
ThreadPool(String),
}