zuke.tools.cspell

← Python API reference

@zuke/cspell 1.2.0: @zuke/cspell — typed cspell task wrappers for Zuke builds.

Symbols

#

CspellSettings

class
class CspellSettings(ToolSettings)

Settings for a cspell lint run.

  • files(*globs: str) -> Self

    Files or globs to check (positional); repeatable.

  • config(path: str) -> Self

    Use an explicit config file (-c/--config).

  • no_progress() -> Self

    Suppress the progress output (--no-progress).

  • no_summary() -> Self

    Suppress the summary line (--no-summary).

  • show_suggestions() -> Self

    Print spelling suggestions for each issue (--show-suggestions).

  • show_context() -> Self

    Print the surrounding line for each issue (--show-context).

  • quiet_output() -> Self

    Only emit issues, hiding informational output (--quiet).

  • cache() -> Self

    Cache results between runs (--cache).

  • dot() -> Self

    Include dotfiles and dot-directories (--dot).

  • gitignore() -> Self

    Honour .gitignore files (--gitignore).

  • gitignore_root(path: str) -> Self

    Stop the .gitignore search at this directory (--gitignore-root). Without it cspell keeps walking up past the repository root and can pick up an unrelated .gitignore from a parent directory — so a run inside a git worktree, whose checkout lives outside the main working tree, sees ignore rules that do not belong to it. Point this at the repository root to bound the search.

  • no_must_find_files() -> Self

    Exit successfully when a glob matches nothing (--no-must-find-files). cspell fails by default if any file argument matched no files. A run scoped to a computed file list — the staged files, the files a diff touched — can legitimately be empty, so a file-scoped run wants this.

  • unique() -> Self

    Report each unique issue only once (--unique).

  • locale(value: str) -> Self

    Restrict to a locale, e.g. en,en-GB (--locale).

  • exclude(glob: str) -> Self

    Exclude files matching a glob (-e/--exclude); repeatable.

  • max_duplicate_problems(count: float) -> Self

    Cap the number of duplicate problems reported (--max-duplicate-problems).

#

CspellTasks

class
class CspellTasks

Typed task functions for the cspell spell-checker.

  • static async lint(ctx: ServiceContext, configure: Callable[[CspellSettings], CspellSettings] | None=None) -> ExecResult

    Spell-check with cspell lint.