From 05e68fd9025e0a0c729fb1b580866150f214cf24 Mon Sep 17 00:00:00 2001 From: ssendev Date: Thu, 22 Aug 2013 11:25:22 +0200 Subject: [PATCH] add new option `--table-width` for text report --- lib/brakeman.rb | 2 ++ lib/brakeman/options.rb | 4 ++++ lib/brakeman/util.rb | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/brakeman.rb b/lib/brakeman.rb index 2262d6a8..6c64ca7c 100644 --- a/lib/brakeman.rb +++ b/lib/brakeman.rb @@ -41,6 +41,7 @@ module Brakeman # * :safe_methods - array of methods to consider safe # * :skip_libs - do not process lib/ directory (default: false) # * :skip_checks - checks not to run (run all if not specified) + # * :table_width - limit width of table in text report # * :absolute_paths - show absolute path of each file (default: false) # * :summary_only - only output summary section of report # (does not apply to tabs format) @@ -126,6 +127,7 @@ module Brakeman :ignore_redirect_to_model => true, :ignore_model_output => false, :message_limit => 100, + :table_width => 80, :parallel_checks => true, :relative_path => false, :report_progress => true, diff --git a/lib/brakeman/options.rb b/lib/brakeman/options.rb index ea295201..cf977221 100644 --- a/lib/brakeman/options.rb +++ b/lib/brakeman/options.rb @@ -177,6 +177,10 @@ module Brakeman::Options options[:message_limit] = limit.to_i end + opts.on "--table-width WIDTH", "Limit table width in text report" do |width| + options[:table_width] = width.to_i + end + opts.on "-o", "--output FILE", "Specify files for output. Defaults to stdout. Multiple '-o's allowed" do |file| options[:output_files] ||= [] options[:output_files].push(file) diff --git a/lib/brakeman/util.rb b/lib/brakeman/util.rb index 4070f7d9..6ec11f98 100644 --- a/lib/brakeman/util.rb +++ b/lib/brakeman/util.rb @@ -388,7 +388,7 @@ module Brakeman::Util Brakeman.load_brakeman_dependency 'highline' ::HighLine.new.terminal_size[0] else - @tracker.options[:message_limit] + @tracker.options[:table_width] end lines = str.lines -- GitLab