zuke.tools.lint_staged

← Python API reference

@zuke/lint-staged 1.0.0: @zuke/lint-staged — typed lint-staged task wrappers for Zuke builds.

Symbols

#

LintStagedSettings

class
class LintStagedSettings(ToolSettings)

Settings for a lint-staged run.

  • config(path: str) -> Self

    Use an explicit config file (--config).

  • relative() -> Self

    Pass file paths relative to the working directory rather than absolute (--relative). Tools configured with root-relative globs — the usual case for an ESLint or Prettier config committed at the repo root — only match when the paths handed to them are relative too.

  • concurrent(tasks: float) -> Self

    Run at most tasks linter tasks at once (--concurrent <n>). Use 1 to serialise them — what a tool that writes shared state (a cache, a lockfile) needs.

  • allow_empty() -> Self

    Exit successfully when the tasks left nothing staged (--allow-empty). Without it a formatter that reverts the only staged change fails the run, because the resulting commit would be empty.

  • diff(ref: str) -> Self

    Take the file list from a diff instead of the staged files (--diff <ref>), e.g. main...HEAD to lint everything a branch touched.

  • shell() -> Self

    Run the configured commands through a shell instead of parsing them (--shell).

#

LintStagedTasks

class
class LintStagedTasks

Typed task functions for lint-staged.

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

    Run the configured linters over the staged files: lint-staged.