Skip to content

refactor: Centralize logic for normalizing strings in parser classes #1289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

larshelge
Copy link
Contributor

@larshelge larshelge commented Mar 12, 2025

Thanks for contributing.

Description

Centralizes logic for normalizing (pre-processing) strings as part of column type parsing.

Note this is mostly my own code from 5 years ago.

Testing

Existing test coverage is sufficient.

The Codacy warnings are questionable IMHO.

A review would be greatly appreciated @lwhite1 @benmccann.

if (ignoreZeroDecimal) {
s = StringUtils.removeZeroDecimal(s);
str = StringUtils.removeZeroDecimal(str);
Copy link
Collaborator

Choose a reason for hiding this comment

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

reassigning a variable causes a warning in codacy

Copy link
Contributor Author

@larshelge larshelge Apr 10, 2025

Choose a reason for hiding this comment

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

Yep I noticed. I was thinking the code was like this to begin with and it is easy to end up with a growing task when starting to fix issues not introduced by the current PR. It is a also questionable IMHO that reassigning variables is bad practice. I am happy to change it @benmccann .

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