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
1 change: 1 addition & 0 deletions src/docstub-stubs/_app_generate_stubs.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# File generated with docstub

import logging
import sys
import time
from collections import Counter
from collections.abc import Iterable, Sequence
Expand Down
2 changes: 2 additions & 0 deletions src/docstub-stubs/_config.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import logging
import tomllib
from collections.abc import Mapping
from pathlib import Path
from pprint import pformat
from typing import ClassVar, Self

logger: logging.Logger
Expand All @@ -27,5 +28,6 @@ class Config:
def to_dict(self) -> None: ...
def __post_init__(self) -> None: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
@staticmethod
def validate(mapping: Mapping) -> None: ...
4 changes: 4 additions & 0 deletions src/docstub/_app_generate_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""

import logging
import sys
import time
from collections import Counter
from contextlib import contextmanager
Expand Down Expand Up @@ -276,6 +277,8 @@ def generate_stubs(
verbosity=verbosity, group_errors=group_errors
)

logger.debug("Command line args: %s", sys.orig_argv)

root_path = Path(root_path)
if root_path.is_file():
logger.warning(
Expand All @@ -290,6 +293,7 @@ def generate_stubs(

config = _load_configuration(config_paths)
config = config.merge(Config(ignore_files=list(ignore)))
logger.debug("Fully loaded config:\n%s", config)

types, type_prefixes = _collect_type_info(
root_path, ignore=config.ignore_files, cache=not no_cache
Expand Down
2 changes: 2 additions & 0 deletions src/docstub/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ def clean(verbose, quiet):
verbosity = _calc_verbosity(verbose=verbose, quiet=quiet)
app.setup_logging(verbosity=verbosity, group_errors=False)

logger.debug("Command line args: %s", sys.orig_argv)

path = app.cache_dir_in_cwd()
if path.exists():
try:
Expand Down
4 changes: 4 additions & 0 deletions src/docstub/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import tomllib
from pathlib import Path
from pprint import pformat
from typing import ClassVar

logger: logging.Logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -72,6 +73,9 @@ def __repr__(self) -> str:
formatted = f"<{type(self).__name__}: {sources}>"
return formatted

def __str__(self) -> str:
return pformat(self.to_dict())

@staticmethod
def validate(mapping):
"""Make sure that a valid Config can be created from `mapping`.
Expand Down
3 changes: 2 additions & 1 deletion src/docstub/_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ class ReportHandler(logging.StreamHandler):
level_to_color : ClassVar[dict[int, str]]
"""

# Use "safe" colors (https://blog.xoria.org/terminal-colors/)
level_to_color = {
logging.DEBUG: "bright_black",
logging.DEBUG: "green",
logging.INFO: "cyan",
logging.WARNING: "yellow",
logging.ERROR: "red",
Expand Down
Loading