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: Optional[LintViolation], error: Optional[Tuple[Exception, str]] = None)

A single lint result for a given file and lint rule

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

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, ~typing.Union[str, int, float]]] = <factory>)

Materialized configuration valid for processing a single file

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