MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / _len_cjk

Function _len_cjk

pre_commit/commands/run.py:36–38  ·  view source on GitHub ↗
(msg: str)

Source from the content-addressed store, hash-verified

34
35
36def _len_cjk(msg: str) -> int:
37 widths = {'A': 1, 'F': 2, 'H': 1, 'N': 1, 'Na': 1, 'W': 2}
38 return sum(widths[unicodedata.east_asian_width(c)] for c in msg)
39
40
41def _start_msg(*, start: str, cols: int, end_len: int) -> str:

Callers 3

_start_msgFunction · 0.85
_full_msgFunction · 0.85
_compute_colsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected