提交 b028fade 编写于 作者: K Kaworu

always apply --table-width if given

上级 05e68fd9
......@@ -41,7 +41,6 @@ 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)
......@@ -127,7 +126,6 @@ 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,
......
......@@ -384,11 +384,13 @@ module Brakeman::Util
end
def truncate_table str
@terminal_width ||= if $stdin && $stdin.tty?
@terminal_width ||= if @tracker.options[:table_width]
@tracker.options[:table_width]
elsif $stdin && $stdin.tty?
Brakeman.load_brakeman_dependency 'highline'
::HighLine.new.terminal_size[0]
else
@tracker.options[:table_width]
80
end
lines = str.lines
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册