How attaditya/cutypy works
CutyPy is a lightweight Python formatter. Its main workflow parses CLI arguments, starts the engine, discovers files, then either checks or formats each file; formatting writes changed content back to disk. The README also documents import sorting, indentation, blank-line normalization, line endings, trailing-space cleanup, EOF newlines, and CI check mode. The graph groups related rules to keep the workflow readable. Some subsystems are represented by their exact source directories because their individual implementations were not excerpted; those links rely on the source index or README.
Main entry points: worker.py Workflow and file I/O · main.py CLI entrypoint · solve.py Solve pipeline · content.py Content state
Components 14
CLI and orchestration
- Argument parsing
cutypy/cli/args_handler.py - Version handling
cutypy/cli/version.py - CLI entrypoint
cutypy/core/main.py
File processing
- Workflow and file I/O
cutypy/engine/worker.py - Path discovery
cutypy/engine/discovery.py - Check pipeline
cutypy/engine/pipelines/check.py - Line-length checker
cutypy/checker/check_line_length.py - Solve pipeline
cutypy/engine/pipelines/solve.py
Formatting rules
- String preservation
cutypy/common - Formatting rules
cutypy/solver
Content and arguments
- Content state
cutypy/models/content.py - Argument state
cutypy/models/args.py
Other components
- CLI user
- Source files
Connections 17
- CLI user → CLI entrypoint: invokes
README.md - CLI entrypoint → Argument parsing: parses arguments
cutypy/core/main.py - CLI entrypoint → Version handling: checks version
cutypy/core/main.py - CLI entrypoint → Workflow and file I/O: starts engine
cutypy/core/main.py - Argument parsing → Argument state: creates
cutypy/cli/args_handler.py - Version handling → Argument state: reads options
cutypy/cli/version.py - Workflow and file I/O → Argument state: reads paths
cutypy/engine/worker.py - Workflow and file I/O → Path discovery: discovers paths
cutypy/engine/worker.py - Workflow and file I/O → Check pipeline: runs check
cutypy/engine/worker.py - Workflow and file I/O → Solve pipeline: runs formatting
cutypy/engine/worker.py - Workflow and file I/O → Source files: reads and writes
cutypy/engine/worker.py - Workflow and file I/O → Content state: creates content
cutypy/engine/worker.py - Check pipeline → Line-length checker: checks content
cutypy/engine/pipelines/check.py - Solve pipeline → String preservation: preserves strings
cutypy/engine/pipelines/solve.py - Solve pipeline → Formatting rules: applies rules
cutypy/engine/pipelines/solve.py - String preservation → Content state: transforms content
cutypy/common/compact.py - Formatting rules → Content state: transforms content
cutypy/solver/fix_import_order.py