Ccodemod

codemod/abap-no-tabulation-characters

Replace literal tab characters in ABAP source files with spaces.

abapwhitespacequick-fixstyleguide
Public
0 executions

Run locally

npx codemod @codemod/abap-no-tabulation-characters

@codemod/abap-no-tabulation-characters

Replace literal tab characters in ABAP source files with spaces.

Installation

bash

Usage

This codemod rewrites every contiguous run of literal tab characters (\t, U+0009) in *.abap files to a single space.

It is intended for ABAP repositories where pasted source accidentally contains tab characters instead of spaces.

What it changes

  • data: lt_file\ttype solix_tab. becomes data: lt_file type solix_tab.
  • \t\tIF foo = bar. becomes IF foo = bar.
  • IF foo = bar.\t becomes IF foo = bar.

What it targets

  • Files ending in .abap
  • Recursive scan from the target directory
  • Ignores .git, node_modules, dist, and build

No-op cases

  • .abap files that already contain no literal tabs
  • Non-ABAP files

Development

bash

License

MIT

Ready to contribute?

Build your own codemod and share it with the community.