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

common/TextTable,mgr: standardize on 2 spaces between table columns #33138

Merged
merged 5 commits into from Feb 25, 2020

Conversation

liewegas
Copy link
Member

@liewegas liewegas commented Feb 8, 2020

--- RAW STORAGE ---
CLASS  SIZE     AVAIL   USED     RAW USED  %RAW USED  
ssd    101 GiB  99 GiB  1.0 GiB   2.0 GiB       1.98  
TOTAL  101 GiB  99 GiB  1.0 GiB   2.0 GiB       1.98  
 
--- POOLS ---
POOL  ID  STORED  OBJECTS  USED  %USED  MAX AVAIL  
foo    1     0 B        0   0 B      0     98 GiB  

@liewegas liewegas requested a review from a team as a code owner February 8, 2020 19:24
@liewegas liewegas added the core label Feb 8, 2020
*
* @param s String to separate columns
*/
void set_column_separation(const std::string& s) {
Copy link
Contributor

Choose a reason for hiding this comment

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

where is this method used?

Copy link
Member Author

Choose a reason for hiding this comment

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

no callers

@@ -53,6 +53,7 @@ class TextTable {
std::vector<TextTableColumn> col; // column definitions
unsigned int curcol, currow; // col, row being inserted into
unsigned int indent; // indent width when rendering
std::string column_separation = {" "};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
std::string column_separation = {" "};
constexpr static std::string_view column_separation = {" "};

@liewegas liewegas force-pushed the wip-table-sep branch 2 times, most recently from 7c64882 to 592d692 Compare February 20, 2020 23:37
Copy link
Contributor

@sebastian-philipp sebastian-philipp left a comment

Choose a reason for hiding this comment

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

python code lgtm

@liewegas
Copy link
Member Author

retest this please

This is what other projects and libraries default to, and it is more
legible.

Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
@liewegas
Copy link
Member Author

retest this please

No need to pad on the right-hand side if there are no additional columns
that follow.

Signed-off-by: Sage Weil <sage@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants