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

Function _get_platform_max_length

pre_commit/xargs.py:49–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48
49def _get_platform_max_length() -> int: # pragma: no cover (platform specific)
50 if os.name == 'posix':
51 maximum = os.sysconf('SC_ARG_MAX') - 2048 - _environ_size()
52 maximum = max(min(maximum, 2 ** 17), 2 ** 12)
53 return maximum
54 elif os.name == 'nt':
55 return 2 ** 15 - 2048 # UNICODE_STRING max - headroom
56 else:
57 # posix minimum
58 return 2 ** 12
59
60
61def _command_length(*cmd: str) -> int:

Callers 2

partitionFunction · 0.85
xargsFunction · 0.85

Calls 1

_environ_sizeFunction · 0.85

Tested by

no test coverage detected