Skip to content
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

Refactor bmqu::AlignedPrinter to accept vector of strings #564

Open
5 tasks
678098 opened this issue Jan 13, 2025 · 2 comments
Open
5 tasks

Refactor bmqu::AlignedPrinter to accept vector of strings #564

678098 opened this issue Jan 13, 2025 · 2 comments
Labels
good first issue Good for newcomers

Comments

@678098
Copy link
Collaborator

678098 commented Jan 13, 2025

Is your feature request related to a problem?

bmqu::AlignedPrinter class has some problems:

  • The class' API expects bsl::vector<const char*> argument which is strange. The conventional way is to pass bsl::vector<bsl::string>.
  • It also stores this vector as a field.
  • To get the const char* length, bsl::strlen is used.

const bsl::vector<const char*>* fields,

Describe the solution you'd like

Refactor bmqu::AlignedPrinter, so:

  • bmqu::AlignedPrinter constructor expects bsl::string, not const char*
  • bmqu::AlignedPrinter also stores these strings as a const bsl::vector<bsl::string> field (might be a pointer, might be a reference)
  • Add precondition assert that d_fields_p is not NULL in constructor AlignedPrinter::AlignedPrinter or initialize this field as a reference
  • Update usage examples in the unit's documentation
  • Update the code that uses this class

Alternatives you considered

No response

@678098 678098 added enhancement New feature or request good first issue Good for newcomers and removed enhancement New feature or request labels Jan 13, 2025
@ariraein
Copy link

ariraein commented Feb 3, 2025

Hi all. I have started working on this. This is my first time ever trying to contribute to an open-source library. Please forgive my ignorance if there is any issue with commenting here. Just to make sure, I have to complete the checklist above with five items, then follow the steps on Contributing page?
Thanks,
-Ari

@678098
Copy link
Collaborator Author

678098 commented Feb 4, 2025

Just to make sure, I have to complete the checklist above with five items

Hi Ari, that is correct. It's not enough to only modify bmqu::AlignedPrinter class API, because this class is used in several places, and the project build will be broken if we introduce a mismatch between class API and its usage in other components. If we merge a PR with a partial change, the build will be broken for everyone, and this is not good.

then follow the steps on Contributing page?

Yes. The most common problem on new contributions is DCO check. You need to ensure that you add DCO signature to all of your commits with -s flag: git commit -s -m "<My feature>"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants