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

thht / plus_sync / 213

04 May 2026 07:05AM UTC coverage: 64.842% (-27.2%) from 92.008%
213

push

gitlab-ci

update deps

616 of 950 relevant lines covered (64.84%)

0.65 hits per line

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

35.29
/src/plus_sync/cmd/commands/init.py
1
from typing import Annotated
×
2

3
import typer
×
4

5
from plus_sync.cmd.helpers.options import global_options
×
6
from plus_sync.config import Config
×
7

8
from ..app import app
×
9

10

11
@app.command()
×
12
def init(
×
13
    project_name: Annotated[str, typer.Option(help='The name of the project.', prompt=True)],
14
    overwrite: Annotated[bool, typer.Option(help='Overwrite the configuration file if it already exists.')] = False,
15
) -> None:
16
    """
17
    Initialize a new configuration file.
18
    """
19
    typer.echo(f'Initializing a new configuration file at {global_options["config_file"]}.')
1✔
20
    config = Config(project_name=project_name)
1✔
21
    if global_options['config_file'] is None:
1✔
22
        raise typer.Exit(code=1)
×
23
    try:
1✔
24
        config.save(global_options['config_file'], overwrite=overwrite)
1✔
25
    except FileExistsError:
×
26
        typer.echo('The file already exists. Use --overwrite to overwrite it.')
×
27
        raise typer.Exit(code=1)
×
28
    typer.echo('Done.')
1✔
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