Skip to content
This repository has been archived by the owner on May 8, 2018. It is now read-only.

Commit

Permalink
Make sure the table width is a minimum width
Browse files Browse the repository at this point in the history
  • Loading branch information
koresar committed Apr 10, 2017
1 parent da2b275 commit 904dc3e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/formatters/default.js
Expand Up @@ -17,8 +17,12 @@ module.exports = function (err, data, pkgPath) {
}

var width = 80;
var colWidth = 15;
if (process.stdout.isTTY) {
width = (process.stdout.getWindowSize()[0] - 10) || 80;
width = process.stdout.getWindowSize()[0] - 10;
if (!width || width <= colWidth) {
width = 80;
}
}
if (data.length === 0) {

Expand All @@ -34,7 +38,7 @@ module.exports = function (err, data, pkgPath) {

var table = new Table({
head: ['', finding.title],
colWidths: [15, width - 15]
colWidths: [colWidth, width - colWidth]
});

table.push(['Name', finding.module]);
Expand Down

0 comments on commit 904dc3e

Please sign in to comment.