nitpick.style package

Styles parsing and merging.

class nitpick.style.StyleManager(project: Project, offline: bool, cache_option: str)[source]

Bases: object

Include styles recursively from one another.

property cache_dir: Path

Clear the cache directory (on the project root or on the current directory).

cache_option: str
static file_field_pair(filename: str, base_file_class: type[NitpickPlugin]) dict[str, fields.Field][source]

Return a schema field with info from a config file class.

find_initial_styles(configured_styles: Sequence[str], base: str | None = None) Iterator[Fuss][source]

Find the initial style(s) and include them.

base is the URL for the source of the initial styles, and is used to resolve relative references. If omitted, defaults to the project root.

static get_default_style_url(github=False) furl[source]

Return the URL of the default style/preset.

include_multiple_styles(chosen_styles: Iterable[furl]) Iterator[Fuss][source]

Include a list of styles (or just one) into this style tree.

load_fixed_name_plugins() Set[Type[NitpickPlugin]][source]

Separate classes with fixed file names from classes with dynamic files names.

merge_toml_dict() JsonDict[source]

Merge all included styles into a TOML (actually JSON) dictionary.

offline: bool
project: Project
rebuild_dynamic_schema() None[source]

Rebuild the dynamic Marshmallow schema when needed, adding new fields that were found on the style.

nitpick.style.parse_cache_option(cache_option: str) tuple[CachingEnum, timedelta | int][source]

Parse the cache option provided on pyproject.toml.

If no cache if provided or is invalid, the default is one hour.

Subpackages

Submodules