• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TopNik073 / def-form / 21400430468

27 Jan 2026 02:11PM UTC coverage: 77.732%. First build
21400430468

Pull #1

github

web-flow
Merge 583225676 into 36edf464c
Pull Request #1: feat: Setup project

377 of 485 new or added lines in 12 files covered. (77.73%)

377 of 485 relevant lines covered (77.73%)

0.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/def_form/cli/cli.py
NEW
1
import sys
×
2

NEW
3
import click
×
4

NEW
5
from def_form.exceptions.base import BaseDefFormException
×
NEW
6
from def_form.formatters import DefManager
×
7

8

NEW
9
@click.command()
×
NEW
10
@click.argument('path', type=str, default='src')
×
NEW
11
@click.option('--max-def-length', type=int, default=None, help='max length of your function definition')
×
NEW
12
@click.option('--max-inline-args', type=int, default=None, help='max number of inline arguments')
×
NEW
13
@click.option('--indent-size', type=int, default=None, help='indent size in spaces (default: 4)')
×
NEW
14
@click.option('--config', type=str, default=None, help='path to pyproject.toml')
×
NEW
15
@click.option('--exclude', multiple=True, help='paths to exclude from formatting')
×
NEW
16
@click.option('--show-skipped', is_flag=True, help='show skipped files/directories')
×
NEW
17
def format(  # noqa: PLR0913
×
18
    path: str,
19
    max_def_length: int | None,
20
    max_inline_args: int | None,
21
    indent_size: int | None,
22
    config: str | None,
23
    exclude: tuple[str, ...],
24
    show_skipped: bool,
25
) -> None:
NEW
26
    click.echo('Start formatting your code')
×
NEW
27
    try:
×
NEW
28
        DefManager(
×
29
            path=path,
30
            excluded=exclude,
31
            max_def_length=max_def_length,
32
            max_inline_args=max_inline_args,
33
            indent_size=indent_size,
34
            config=config,
35
            show_skipped=show_skipped,
36
        ).format()
NEW
37
    except Exception as e:
×
NEW
38
        click.echo(f'Something went wrong: {e}', err=True)
×
NEW
39
        sys.exit(1)
×
40
    else:
NEW
41
        click.echo('Formatted!')
×
42

43

NEW
44
@click.command()
×
NEW
45
@click.argument('path', type=str, default='src')
×
NEW
46
@click.option('--max-def-length', type=int, default=None, help='max length of your function definition')
×
NEW
47
@click.option('--max-inline-args', type=int, default=None, help='max number of inline arguments')
×
NEW
48
@click.option('--indent-size', type=int, default=None, help='indent size in spaces (default: 4)')
×
NEW
49
@click.option('--config', type=str, default=None, help='path to pyproject.toml')
×
NEW
50
@click.option('--exclude', multiple=True, help='paths to exclude from checking')
×
NEW
51
@click.option('--show-skipped', is_flag=True, help='show skipped files/directories')
×
NEW
52
def check(  # noqa: PLR0913
×
53
    path: str,
54
    max_def_length: int | None,
55
    max_inline_args: int | None,
56
    indent_size: int | None,
57
    config: str | None,
58
    exclude: tuple[str, ...],
59
    show_skipped: bool,
60
) -> None:
NEW
61
    click.echo('Start checking your code')
×
NEW
62
    try:
×
NEW
63
        DefManager(
×
64
            path=path,
65
            excluded=exclude,
66
            max_def_length=max_def_length,
67
            max_inline_args=max_inline_args,
68
            indent_size=indent_size,
69
            config=config,
70
            show_skipped=show_skipped,
71
        ).check()
NEW
72
    except BaseDefFormException:
×
NEW
73
        sys.exit(1)
×
NEW
74
    except Exception as e:
×
NEW
75
        click.echo(f'Something went wrong: {e}', err=True)
×
NEW
76
        sys.exit(1)
×
77
    else:
NEW
78
        click.echo('All checks passed!')
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc