Skip to content

Feat PadLines: added "Mode" argument#2359

Open
oliver-mitchell wants to merge 3 commits intogchq:masterfrom
oliver-mitchell:oliver-mitchell/feat/add-pad-lines-mode
Open

Feat PadLines: added "Mode" argument#2359
oliver-mitchell wants to merge 3 commits intogchq:masterfrom
oliver-mitchell:oliver-mitchell/feat/add-pad-lines-mode

Conversation

@oliver-mitchell
Copy link
Copy Markdown

Commit overview:

  • Added "Mode" argument to the Pad Lines operation.
  • Added "Fixed Count" mode. Mimics original behaviour, fixed number of characters added to the string.
  • Added "Target Length" mode. Adds padding characters in order to reach a certain length.
  • Modified Pad lines implementation to use join rather than slice for final result

Description
Adds a new "Mode" argument to the "Pad Lines" operation. Mode allows the user to configure how many padding characters are added.

The default mode "Fixed Count" mimics the existing behaviour; a fixed number of padding characters is added to the start or end of the string.

The alternative mode "Target Length" differs from "Fixed Count" in that the number of padding characters added is variable; the count argument is instead interpreted as the target length of the overall line.

Existing Issue
N/A

Screenshots
Screenshot 2026-05-06 at 12 37 41 AM

AI disclosure
No AI was used for this change.

Test Coverage
Tests have been added for the Pad line operation.

- Added "Mode" argument to the Pad Lines operation.
- Added "Fixed Count" mode. Mimics original behaviour, fixed number of characters added to the string.
- Added "Target Length" mode. Adds padding characters in order to reach a certain length.
- Modified Pad lines implementation to use join rather than slice for final result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant