fitzzftw.patch.protocols¶
---
config:
height: 300px
width: 300px
title: protocols
---
classDiagram
BackupOptions <|-- FtwPatchApplyOptions
CommonOptions <|-- ArgParsOptions
DiffCodeOptions <|-- FtwPatchApplyOptions
FtwPatchApplyOptions <|-- ArgParsOptions
HunkCompareOptions <|-- DiffCodeOptions
Protocol <|-- BackupOptions
Protocol <|-- CommonOptions
Protocol <|-- DiffCodeOptions
Protocol <|-- HunkCompareOptions
Protocol <|-- LineLike
Protocol <|-- WhitespaceOptions
WhitespaceOptions <|-- ArgParsOptions
Inheritage diagramm for protocols¶
Structural Protocols and Type Hints¶
This module defines the structural interfaces (Protocols) used for static type checking and runtime validation throughout the fitzzftw framework.
Core Protocols:¶
- LineLike:
The primary protocol for terminal output. It ensures that an object provides the necessary metadata for semantic coloring.
- ArgParsOptions & Friends:
A hierarchy of protocols that define the expected structure for configuration objects, ranging from whitespace rules to backup settings.
Key Features:¶
- Runtime Validation:
Utilizes
@runtime_checkablefor protocols likeLineLiketo enable safeisinstance()checks in mixins.
- Granular Configuration:
Splits application options into logical units (e.g.,
BackupOptions,WhitespaceOptions) to allow for flexible dependency injection.
Classes
Comprehensive protocol representing all CLI-provided arguments. |
|
Interface for file backup configuration. |
|
Global framework options for logging and execution mode. |
|
Extension of comparison options to include file-level strip counts. |
|
Combined protocol for the core patch application logic. |
|
Interface for options governing how hunks are compared during matching. |
|
Protocol defining the minimal interface for a line object to be printable. |
|
Specialized options for whitespace normalization rules. |