Registry
Ccodemod avatar

codemod/abap-line-length-mining

Wrap overlong ABAP full-line comments without rewriting executable statements.

codemod0 executions

  • abap
  • line-length
  • comments
  • transformation
Connect a repo
npx codemod @codemod/abap-line-length-mining

@codemod/abap-line-length-mining

Wrap overlong ABAP full-line comments so they fit under a configurable line-length limit without rewriting executable statements.

Installation

bash
# Run locally
pnpm exec tsx scripts/codemod.ts --target /path/to/abap/project --maximum-line-length 120

# Or run through the workflow package
pnpm dlx codemod@latest workflow run -w . -t /path/to/abap/project

Usage

This codemod rewrites only full-line ABAP comments when they exceed maximumLineLength.

  • Rewrites lines that start with * or with " after indentation.
  • Splits long comment text at word boundaries and hard-wraps single words when needed.
  • Targets *.abap files recursively.
  • Preserves executable ABAP statements and end-of-line comments unchanged.
  • Skips comments that already fit within the configured maximum.

The transform uses a text-based rewrite because ABAP is not a parser-backed JSSG language in this package scaffold.

Development

bash
# Test the transformation
pnpm test

# Validate the workflow
pnpm dlx codemod@latest workflow validate -w workflow.yaml

# Publish to registry
pnpm dlx codemod@latest login
pnpm dlx codemod@latest publish

License

MIT

Ready to evolve your codebase?

Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.