提交 05e68fd9 编写于 作者: S ssendev

add new option `--table-width` for text report

上级 0a4b26f0
...@@ -41,6 +41,7 @@ module Brakeman ...@@ -41,6 +41,7 @@ module Brakeman
# * :safe_methods - array of methods to consider safe # * :safe_methods - array of methods to consider safe
# * :skip_libs - do not process lib/ directory (default: false) # * :skip_libs - do not process lib/ directory (default: false)
# * :skip_checks - checks not to run (run all if not specified) # * :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) # * :absolute_paths - show absolute path of each file (default: false)
# * :summary_only - only output summary section of report # * :summary_only - only output summary section of report
# (does not apply to tabs format) # (does not apply to tabs format)
...@@ -126,6 +127,7 @@ module Brakeman ...@@ -126,6 +127,7 @@ module Brakeman
:ignore_redirect_to_model => true, :ignore_redirect_to_model => true,
:ignore_model_output => false, :ignore_model_output => false,
:message_limit => 100, :message_limit => 100,
:table_width => 80,
:parallel_checks => true, :parallel_checks => true,
:relative_path => false, :relative_path => false,
:report_progress => true, :report_progress => true,
......
...@@ -177,6 +177,10 @@ module Brakeman::Options ...@@ -177,6 +177,10 @@ module Brakeman::Options
options[:message_limit] = limit.to_i options[:message_limit] = limit.to_i
end 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| opts.on "-o", "--output FILE", "Specify files for output. Defaults to stdout. Multiple '-o's allowed" do |file|
options[:output_files] ||= [] options[:output_files] ||= []
options[:output_files].push(file) options[:output_files].push(file)
......
...@@ -388,7 +388,7 @@ module Brakeman::Util ...@@ -388,7 +388,7 @@ module Brakeman::Util
Brakeman.load_brakeman_dependency 'highline' Brakeman.load_brakeman_dependency 'highline'
::HighLine.new.terminal_size[0] ::HighLine.new.terminal_size[0]
else else
@tracker.options[:message_limit] @tracker.options[:table_width]
end end
lines = str.lines lines = str.lines
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册