API Reference

Simple API

fixit.fixit_paths(paths: Iterable[Path]) Generator[Result, None, None]

Lint multiple files or directories, recursively expanding each path.

fixit.fixit_file(path: Path) Generator[Result, None, None]

Lint a single file on disk.

fixit.print_result(result: Result, debug: bool = False) None

Print linting results in a clear format for easy understanding

class fixit.Result(path: Path, violation: LintViolation | None, error: Tuple[Exception, str] | None = None)

A single lint result for a given file and lint rule

error: Tuple[Exception, str] | None = None
path: Path
violation: LintViolation | None

Advanced API

fixit.fixit_bytes(path: Path, content: bytes, *, config: Config) Generator[Result, None, None]

Lint raw bytes content representing a single path, using the given configuration.

class fixit.Config(path: ~pathlib.Path = <factory>, root: ~pathlib.Path = <factory>, enable: ~typing.List[~fixit.ftypes.QualifiedRule] = <factory>, disable: ~typing.List[~fixit.ftypes.QualifiedRule] = <factory>, options: ~typing.Dict[str, ~typing.Dict[str, str | int | float]] = <factory>)

Materialized configuration valid for processing a single file

disable: List[QualifiedRule]
enable: List[QualifiedRule]
options: Dict[str, Dict[str, str | int | float]]
path: Path
root: Path