Skip to content

Commit 784b696

Browse files
committed
maintain: remove dead code
1 parent bce1e99 commit 784b696

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

src/mdformat/_cli.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import argparse
44
from collections.abc import Generator, Iterable, Mapping, Sequence
55
import contextlib
6-
import inspect
76
import logging
87
import os.path
98
from pathlib import Path
@@ -426,12 +425,6 @@ def log_handler_applied(
426425
logger.removeHandler(handler)
427426

428427

429-
def get_package_name(obj: object) -> str | None:
430-
"""Return top level module name, or None if not found."""
431-
module = inspect.getmodule(obj)
432-
return module.__name__.split(".", maxsplit=1)[0] if module else None
433-
434-
435428
def get_plugin_info_str(
436429
parser_extension_dists: Mapping[str, tuple[str, list[str]]],
437430
codeformatter_dists: Mapping[str, tuple[str, list[str]]],

tests/test_cli.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77

88
import mdformat
9-
from mdformat._cli import get_package_name, get_plugin_info_str, run, wrap_paragraphs
9+
from mdformat._cli import get_plugin_info_str, run, wrap_paragraphs
1010
from mdformat.plugins import CODEFORMATTERS, PARSER_EXTENSIONS
1111
from tests.utils import (
1212
FORMATTED_MARKDOWN,
@@ -345,13 +345,6 @@ def test_eol__check_keep_crlf(tmp_path):
345345
assert run((str(file_path), "--check", "--end-of-line=keep")) == 1
346346

347347

348-
def test_get_package_name():
349-
# Test a function/class
350-
assert get_package_name(patch) == "unittest"
351-
# Test a package/module
352-
assert get_package_name(mdformat) == "mdformat"
353-
354-
355348
def test_get_plugin_info_str():
356349
info = get_plugin_info_str(
357350
{"mdformat-tables": ("0.1.0", ["tables"])},

0 commit comments

Comments
 (0)