Well Known File Content Transformers
Provides common implementations of FileContentTransformer for reducing file content bloat. These transformers can be used to clean up file content before sending it to LLMs or other text processing systems to reduce token usage and improve performance by helping them to focus on essential code.
Properties
Removes excessive whitespace from file content
Removes Apache License headers commonly found at the top of source files.
Removes documentation comments (/** ... */) from the code.
Removes empty lines from file content
Removes import statements from the code.
Removes single-line comments (// ...) from the code.
Functions
Returns all available sanitizers in a sensible order for maximum content reduction. The order is important to ensure proper sanitization.
Returns sanitizers focused on comment removal only.
Returns a minimal set of sanitizers that preserve code structure while still reducing file size.
Returns sanitizers focused on whitespace cleanup only.