Skip to content

Conversation

@delei
Copy link
Member

@delei delei commented Sep 5, 2025

Purpose of the pull request

Close #421

What's changed?

  • add strip and isBlankChar methods for whitespace handling in the StringUtils.
  • add a parameter named autoStrip with a default value of false.
  • automatic strip includes sheet name and content.

BTW, we may upgrade to a higher JDK version in the future. At that time, we will only need to modify the StringUtils#strip method , such as replacing it with java.lang.String#strip.

Checklist

  • I have read the Contributor Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

@delei delei requested a review from alaahong September 5, 2025 17:38
@delei delei marked this pull request as ready for review September 6, 2025 06:16
@delei delei removed the request for review from jipengfei-jpf September 6, 2025 06:16
@alaahong alaahong requested a review from Copilot September 6, 2025 10:05
Copy link
Contributor

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

This PR adds a new autoStrip parameter with a default value of false to complement the existing autoTrim functionality. The feature provides automatic whitespace stripping for both sheet names and cell content, supporting a broader range of whitespace characters compared to standard trim operations.

  • Add StringUtils.strip() and StringUtils.isBlankChar() methods for enhanced whitespace handling
  • Integrate autoStrip parameter throughout the codebase (readers, writers, and configuration)
  • Update sheet name matching logic to support stripping of whitespace characters

Reviewed Changes

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

Show a summary per file
File Description
StringUtils.java Adds strip() method and isBlankChar() helper for extended whitespace detection
StringUtilsTest.java Comprehensive tests for the new strip functionality
AutoStripParameterTest.java Integration tests covering autoStrip behavior across Excel formats
ParameterUtil.java Utility methods for determining autoTrim/autoStrip flags in read/write contexts
GlobalConfiguration.java Adds autoStrip configuration with default false value
Multiple handlers Updates cell data processing to apply strip logic when autoStrip is enabled
CSV builders Integrates autoStrip with CSV trim behavior
SheetUtils.java Updates sheet name matching to support autoStrip functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@psxjoy psxjoy left a comment

Choose a reason for hiding this comment

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

LGTM

@psxjoy psxjoy merged commit 2d84428 into apache:main Sep 10, 2025
6 checks passed
@delei delei deleted the improve-421 branch September 10, 2025 12: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.

[Improve] autoTrim needs to support removing full-width spaces

3 participants