Styles parsing and merging.

class nitpick.project.Project, offline: bool, cache_option: str, _first_full_path: str = '')[source]

Bases: object

Include styles recursively from one another.

property cache_dir: pathlib.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[nitpick.plugins.base.NitpickPlugin]) Dict[str, marshmallow.fields.Field][source]

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

find_initial_styles(configured_styles: Union[str, Iterable[str]]) Iterator[nitpick.violations.Fuss][source]

Find the initial style(s) and include them.

static get_default_style_url()[source]

Return the URL of the default style for the current version.

get_style_path(style_uri: str) Tuple[Optional[pathlib.Path], str][source]

Get the style path from the URI. Add the .toml extension if it’s missing.

include_multiple_styles(chosen_styles: Union[str, Iterable[str]]) Iterator[nitpick.violations.Fuss][source]

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

load_fixed_name_plugins() Set[Type[nitpick.plugins.base.NitpickPlugin]][source]

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

merge_toml_dict() Dict[str, Any][source]

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

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

Rebuild the dynamic Marshmallow schema when needed, adding new fields that were found on the style. str) Tuple[nitpick.enums.CachingEnum, datetime.timedelta][source]

Parse the cache option provided on pyproject.toml.

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