WellKnownFileContentTransformers

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

Link copied to clipboard

Removes excessive whitespace from file content

Link copied to clipboard

Removes Apache License headers commonly found at the top of source files.

Link copied to clipboard

Removes documentation comments (/** ... */) from the code.

Link copied to clipboard

Removes empty lines from file content

Link copied to clipboard

Removes import statements from the code.

Link copied to clipboard

Removes single-line comments (// ...) from the code.

Functions

Link copied to clipboard

Returns all available sanitizers in a sensible order for maximum content reduction. The order is important to ensure proper sanitization.

Link copied to clipboard

Returns sanitizers focused on comment removal only.

Link copied to clipboard

Returns a minimal set of sanitizers that preserve code structure while still reducing file size.

Link copied to clipboard

Returns sanitizers focused on whitespace cleanup only.