MCPcopy Index your code
hub / github.com/codespell-project/codespell / main

Method main

codespell_lib/tests/test_basic.py:39–62  ·  view source on GitHub ↗
(
        *args: Any,
        count: bool = True,
        std: bool = False,
    )

Source from the content-addressed store, hash-verified

37
38 @staticmethod
39 def main(
40 *args: Any,
41 count: bool = True,
42 std: bool = False,
43 ) -> Union[int, tuple[int, str, str]]:
44 args = tuple(str(arg) for arg in args)
45 if count:
46 args = ("--count", *args)
47 code = cs_.main(*args)
48 frame = inspect.currentframe()
49 assert frame is not None
50 frame = frame.f_back
51 assert frame is not None
52 capsys = frame.f_locals["capsys"]
53 stdout, stderr = capsys.readouterr()
54 assert code in (EX_OK, EX_USAGE, EX_DATAERR, EX_CONFIG)
55 if code == EX_DATAERR: # have some misspellings
56 code = int(stderr.split("\n")[-2])
57 elif code == EX_OK and count:
58 code = int(stderr.split("\n")[-2])
59 assert code == 0
60 if std:
61 return (code, stdout, stderr)
62 return code
63
64
65cs = MainWrapper()

Callers 15

test_basicFunction · 0.80
test_bad_globFunction · 0.80
test_permission_errorFunction · 0.80
test_interactivityFunction · 0.80
test_summaryFunction · 0.80
test_ignore_dictionaryFunction · 0.80
test_ignore_word_listFunction · 0.80
test_inline_ignoresFunction · 0.80
test_custom_regexFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected