Skip to main content

pedant_types/
language.rs

1use serde::{Deserialize, Serialize};
2
3/// Programming language of a source file that produced a capability finding.
4#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
5#[serde(rename_all = "snake_case")]
6pub enum Language {
7    /// Rust (`.rs`).
8    ///
9    /// Rust capability analysis and symbol resolution belong to `pedant-core`,
10    /// not to the `pedant-lang` backends: this variant names the language a
11    /// shared result carries, not a scanner that handles it. `.rs` therefore
12    /// keeps its dedicated `FileClassification::Rust` path and stays outside
13    /// extension-and-shebang language detection.
14    Rust,
15    /// Python (`.py`).
16    Python,
17    /// JavaScript (`.js`, `.jsx`, `.mjs`, `.cjs`).
18    JavaScript,
19    /// TypeScript (`.ts`, `.tsx`, `.mts`, `.cts`).
20    TypeScript,
21    /// Go (`.go`).
22    Go,
23    /// Bash/shell (`.sh`, `.bash`, `.zsh`).
24    Bash,
25}