Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,9 @@ Example:

Supported options:

- `--offline` to disable network access and rely on caches
- `--quiet` to suppress output
- `--frozen` to leave the virtual environment and lockfile unchanged (i.e. do not install dependencies, nor update lockfiles)

### `usethis rule <rulecode>`

Expand Down
9 changes: 7 additions & 2 deletions src/usethis/_interface/docstyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
import typer

from usethis._core.enums.docstyle import DocStyleEnum
from usethis._options import quiet_opt
from usethis._options import frozen_opt, offline_opt, quiet_opt


def docstyle(
style: DocStyleEnum = typer.Argument(
default="google", help="Docstring style to enforce."
),
offline: bool = offline_opt,
quiet: bool = quiet_opt,
frozen: bool = frozen_opt,
) -> None:
from usethis._config import usethis_config
from usethis._config_file import files_manager
Expand All @@ -20,7 +22,10 @@ def docstyle(

assert isinstance(style, DocStyleEnum)

with usethis_config.set(quiet=quiet), files_manager():
with (
usethis_config.set(offline=offline, quiet=quiet, frozen=frozen),
files_manager(),
):
try:
use_docstyle(style)
except UsethisError as err:
Expand Down
Loading