Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Types

Core data types used across the towl library.

TodoType

#![allow(unused)]
fn main() {
pub enum TodoType {
    Todo,
    Fixme,
    Hack,
    Note,
    Bug,
}
}

Represents the category of a TODO comment.

Display

VariantDisplay
TodoTODO
FixmeFIXME
HackHACK
NoteNOTE
BugBUG

as_filter_str

#![allow(unused)]
fn main() {
pub const fn as_filter_str(&self) -> &'static str
}

Returns the lowercase filter string used for CLI filtering:

VariantFilter string
Todo"todo"
Fixme"fixme"
Hack"hack"
Note"note"
Bug"bug"

Conversions

  • TryFrom<&str> -- Case-insensitive conversion from string
  • clap::ValueEnum -- CLI argument parsing

Trait Implementations

Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, ValueEnum

TodoComment

#![allow(unused)]
fn main() {
pub struct TodoComment {
    pub id: String,
    pub file_path: PathBuf,
    pub line_number: usize,
    pub column_start: usize,
    pub column_end: usize,
    pub todo_type: TodoType,
    pub original_text: String,
    pub description: String,
    pub context_lines: Vec<String>,
    pub function_context: Option<String>,
    pub analysis: Option<AnalysisResult>,
}
}

A single TODO comment extracted from a source file.

FieldDescription
idUnique identifier (generated per extraction)
file_pathPath to the source file
line_number1-based line number
column_start0-based start column of the TODO marker
column_end0-based end column of the TODO marker
todo_typeCategory (Todo, Fixme, etc.)
original_textThe full original comment line
descriptionExtracted description text after the marker
context_linesSurrounding source lines (configurable window)
function_contextEnclosing function name, if detected
analysisLLM validation result, populated when --ai is used (skipped during serialisation if None)

Trait Implementations

Debug, Clone, PartialEq, Serialize, Deserialize

ScanResult

#![allow(unused)]
fn main() {
pub struct ScanResult {
    pub todos: Vec<TodoComment>,
    pub files_scanned: usize,
    pub files_skipped: usize,
    pub files_errored: usize,
    pub duration: std::time::Duration,
}
}

Returned by Scanner::scan(). See Scanner for details.

Owner / Repo

Newtype wrappers for GitHub owner and repository names:

#![allow(unused)]
fn main() {
pub struct Owner(String);
pub struct Repo(String);
}

Both provide try_new(impl Into<String>) -> Result<Self, TowlConfigError> (validates length) and Display. See Config for details.

OutputFormat

#![allow(unused)]
fn main() {
pub enum OutputFormat {
    Table,
    Json,
    Csv,
    Toml,
    Markdown,
    Terminal,
}
}

CLI-facing enum for selecting output format. Table and Terminal produce identical output. See Output for details.