Skip to content

interrogate ¤

Callable for Interrogate.

Functions:

  • run

    Run interrogate.

run ¤

run(
    *src: str,
    verbose: int | None = None,
    quiet: bool | None = None,
    fail_under: float | None = None,
    exclude: str | None = None,
    ignore_init_method: bool | None = None,
    ignore_init_module: bool | None = None,
    ignore_magic: bool | None = None,
    ignore_module: bool | None = None,
    ignore_nested_functions: bool | None = None,
    ignore_nested_classes: bool | None = None,
    ignore_private: bool | None = None,
    ignore_property_decorators: bool | None = None,
    ignore_setters: bool | None = None,
    ignore_semiprivate: bool | None = None,
    ignore_regex: str | None = None,
    whitelist_regex: str | None = None,
    output: str | None = None,
    config: str | None = None,
    color: bool | None = None,
    omit_covered_files: bool | None = None,
    generate_badge: str | None = None,
    badge_format: Literal["png", "svg"] | None = None,
    badge_style: _BADGE_STYLE | None = None
) -> None

Run interrogate.

Parameters:

  • src (str, default: () ) –

    Format the directories and file paths.

  • verbose (int | None, default: None ) –

    Level of verbosity.

  • quiet (bool | None, default: None ) –

    Do not print output.

  • fail_under (float | None, default: None ) –

    Fail when coverage % is less than a given amount.

  • exclude (str | None, default: None ) –

    Exclude PATHs of files and/or directories.

  • ignore_init_method (bool | None, default: None ) –

    Ignore __init__ method of classes.

  • ignore_init_module (bool | None, default: None ) –

    Ignore __init__.py modules.

  • ignore_magic (bool | None, default: None ) –

    Ignore all magic methods of classes.

  • ignore_module (bool | None, default: None ) –

    Ignore module-level docstrings.

  • ignore_nested_functions (bool | None, default: None ) –

    Ignore nested functions and methods.

  • ignore_nested_classes (bool | None, default: None ) –

    Ignore nested classes.

  • ignore_private (bool | None, default: None ) –

    Ignore private classes, methods, and functions starting with two underscores.

  • ignore_property_decorators (bool | None, default: None ) –

    Ignore methods with property setter/getter decorators.

  • ignore_setters (bool | None, default: None ) –

    Ignore methods with property setter decorators.

  • ignore_semiprivate (bool | None, default: None ) –

    Ignore semiprivate classes, methods, and functions starting with a single underscore.

  • ignore_regex (str | None, default: None ) –

    Regex identifying class, method, and function names to ignore.

  • whitelist_regex (str | None, default: None ) –

    Regex identifying class, method, and function names to include.

  • output (str | None, default: None ) –

    Write output to a given FILE.

  • config (str | None, default: None ) –

    Read configuration from pyproject.toml or setup.cfg.

  • color (bool | None, default: None ) –

    Toggle color output on/off when printing to stdout.

  • omit_covered_files (bool | None, default: None ) –

    Omit reporting files that have 100% documentation coverage.

  • generate_badge (str | None, default: None ) –

    Generate a shields.io status badge (an SVG image) in at a given file or directory.

  • badge_format (Literal['png', 'svg'] | None, default: None ) –

    File format for the generated badge.

  • badge_style (_BADGE_STYLE | None, default: None ) –

    Desired style of shields.io badge.

Source code in src/duty/callables/interrogate.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
@lazy(name="interrogate")
def run(
    *src: str,
    verbose: int | None = None,
    quiet: bool | None = None,
    fail_under: float | None = None,
    exclude: str | None = None,
    ignore_init_method: bool | None = None,
    ignore_init_module: bool | None = None,
    ignore_magic: bool | None = None,
    ignore_module: bool | None = None,
    ignore_nested_functions: bool | None = None,
    ignore_nested_classes: bool | None = None,
    ignore_private: bool | None = None,
    ignore_property_decorators: bool | None = None,
    ignore_setters: bool | None = None,
    ignore_semiprivate: bool | None = None,
    ignore_regex: str | None = None,
    whitelist_regex: str | None = None,
    output: str | None = None,
    config: str | None = None,
    color: bool | None = None,
    omit_covered_files: bool | None = None,
    generate_badge: str | None = None,
    badge_format: Literal["png", "svg"] | None = None,
    badge_style: _BADGE_STYLE | None = None,
) -> None:
    """Run `interrogate`.

    Args:
        src: Format the directories and file paths.
        verbose: Level of verbosity.
        quiet: Do not print output.
        fail_under: Fail when coverage % is less than a given amount.
        exclude: Exclude PATHs of files and/or directories.
        ignore_init_method: Ignore `__init__` method of classes.
        ignore_init_module: Ignore `__init__.py` modules.
        ignore_magic: Ignore all magic methods of classes.
        ignore_module: Ignore module-level docstrings.
        ignore_nested_functions: Ignore nested functions and methods.
        ignore_nested_classes: Ignore nested classes.
        ignore_private: Ignore private classes, methods, and functions starting with two underscores.
        ignore_property_decorators: Ignore methods with property setter/getter decorators.
        ignore_setters: Ignore methods with property setter decorators.
        ignore_semiprivate: Ignore semiprivate classes, methods, and functions starting with a single underscore.
        ignore_regex: Regex identifying class, method, and function names to ignore.
        whitelist_regex: Regex identifying class, method, and function names to include.
        output: Write output to a given FILE.
        config: Read configuration from pyproject.toml or setup.cfg.
        color: Toggle color output on/off when printing to stdout.
        omit_covered_files: Omit reporting files that have 100% documentation coverage.
        generate_badge: Generate a shields.io status badge (an SVG image) in at a given file or directory.
        badge_format: File format for the generated badge.
        badge_style: Desired style of shields.io badge.
    """
    from interrogate.cli import main as interrogate

    cli_args: list[str] = list(src)

    if verbose:
        cli_args.append("--verbose")
        cli_args.append(str(verbose))

    if quiet:
        cli_args.append("--quiet")

    if fail_under:
        cli_args.append("--fail-under")
        cli_args.append(str(fail_under))

    if exclude:
        cli_args.append("--exclude")
        cli_args.append(exclude)

    if ignore_init_method:
        cli_args.append("--ignore-init-method")

    if ignore_init_module:
        cli_args.append("--ignore-init-module")

    if ignore_magic:
        cli_args.append("--ignore-magic")

    if ignore_module:
        cli_args.append("--ignore-module")

    if ignore_nested_functions:
        cli_args.append("--ignore-nested-functions")

    if ignore_nested_classes:
        cli_args.append("--ignore-nested-classes")

    if ignore_private:
        cli_args.append("--ignore-private")

    if ignore_property_decorators:
        cli_args.append("--ignore-property-decorators")

    if ignore_setters:
        cli_args.append("--ignore-setters")

    if ignore_semiprivate:
        cli_args.append("--ignore-semiprivate")

    if ignore_regex:
        cli_args.append("--ignore-regex")
        cli_args.append(ignore_regex)

    if whitelist_regex:
        cli_args.append("--whitelist-regex")
        cli_args.append(whitelist_regex)

    if output:
        cli_args.append("--output")
        cli_args.append(output)

    if omit_covered_files:
        cli_args.append("--omit-covered-files")

    if generate_badge:
        cli_args.append("--generate-badge")
        cli_args.append(generate_badge)

    if badge_format:
        cli_args.append("--badge-format")
        cli_args.append(badge_format)

    if badge_style:
        cli_args.append("--badge-style")
        cli_args.append(badge_style)

    if config:
        cli_args.append("--config")
        cli_args.append(config)

    if color is True:
        cli_args.append("--color")
    elif color is False:
        cli_args.append("--no-color")

    interrogate(cli_args)