module documentation

Whitespace error detection and fixing functionality.

This module implements Git's core.whitespace configuration and related whitespace error detection capabilities.

Class WhitespaceChecker Checks for whitespace errors in text content.
Function fix_whitespace_errors Fix whitespace errors in content.
Function parse_whitespace_config Parse core.whitespace configuration value.
Constant DEFAULT_WHITESPACE_ERRORS Undocumented
Constant WHITESPACE_ERROR_TYPES Undocumented
def fix_whitespace_errors(content: bytes, errors: Sequence[tuple[str, int]], fix_types: Set[str] | None = None) -> bytes:

Fix whitespace errors in content.

Parameters
content:bytesOriginal content
errors:Sequence[tuple[str, int]]List of errors from WhitespaceChecker
fix_types:Set[str] | NoneSet of error types to fix (None means fix all)
Returns
bytesFixed content
def parse_whitespace_config(value: str | None) -> tuple[set[str], int]:

Parse core.whitespace configuration value.

Parameters
value:str | NoneThe core.whitespace config value (e.g., "blank-at-eol,space-before-tab")
Returns
tuple[set[str], int]Tuple of (enabled error types, tab width)
DEFAULT_WHITESPACE_ERRORS: set[str] =

Undocumented

Value
set(['blank-at-eol', 'space-before-tab', 'blank-at-eof'])
WHITESPACE_ERROR_TYPES: set[str] =

Undocumented

Value
set(['blank-at-eol',
     'space-before-tab',
     'indent-with-non-tab',
     'tab-in-indent',
     'blank-at-eof',
     'trailing-space',
     'cr-at-eol',
...