Skip to content

refactor(utils): unify str_pad functions#52

Merged
dlyongemallo merged 1 commit intomainfrom
unify_str_pad
Mar 27, 2026
Merged

refactor(utils): unify str_pad functions#52
dlyongemallo merged 1 commit intomainfrom
unify_str_pad

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 24, 2026 11:01
@dlyongemallo dlyongemallo changed the title refactor(utils): unify str_pad functions refactor(utils): unify str_pad functions Mar 24, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors diffview.utils string padding helpers by introducing a single str_pad() implementation and converting the existing left/right/center helpers into thin wrappers, with functional tests added to validate behavior.

Changes:

  • Added utils.str_pad(s, min_size, fill?, align?) to unify padding logic.
  • Updated str_right_pad, str_left_pad, and str_center_pad to delegate to str_pad.
  • Added functional tests covering str_pad and wrapper behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lua/diffview/utils.lua Introduces unified str_pad implementation and refactors existing pad helpers into wrappers.
lua/diffview/tests/functional/utils_spec.lua Adds functional test coverage for str_pad and wrapper functions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lua/diffview/utils.lua Outdated
Comment thread lua/diffview/tests/functional/utils_spec.lua
@dlyongemallo dlyongemallo merged commit 85abefd into main Mar 27, 2026
2 checks passed
@dlyongemallo dlyongemallo deleted the unify_str_pad branch April 8, 2026 01:31
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.

2 participants