Skip to content

Commit

Permalink
fix(cli): fix wonky column calculation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Feb 24, 2020
1 parent 1218f03 commit 89f07d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/cli/src/commands/list-rules.js
Expand Up @@ -22,7 +22,13 @@ const DEFAULT_LIST_RULES_CONFIG = {
value: _.getOr('(no description)', 'description')
}
],
transformers: {table: {outputHeader: 'Available Rules'}}
transformers: {
table: {
outputHeader: 'Available Rules',
colWidths: [20, 60],
truncate: false
}
}
};

export const command = 'list-rules';
Expand Down
2 changes: 1 addition & 1 deletion packages/transformers/src/table.js
Expand Up @@ -116,7 +116,7 @@ const normalizeColWidthPcts = (fields, colWidths, maxWidth) => {
const colWidthPcts = fieldWidthPcts(fields);
if (_.some(_.isNaN, colWidthPcts)) {
const maxPct = 100 - safeSum(colWidthPcts);
if (maxPct <= 100) {
if (maxPct < 100) {
const fieldsCount =
_.size(fields) - _.size(_.filter(_.isNumber, colWidthPcts));
return _.map(
Expand Down

0 comments on commit 89f07d8

Please sign in to comment.