Skip to content

Commit 325e75b

Browse files
committed
Land rapid7#3380, datastore msftidy errors set to INFO
[SeeRM rapid7#8498]
2 parents 21d5e63 + d9fbf86 commit 325e75b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/msftidy.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
require 'time'
1212

1313
CHECK_OLD_RUBIES = !!ENV['MSF_CHECK_OLD_RUBIES']
14+
SUPRESS_INFO_MESSAGES = !!ENV['MSF_SUPPRESS_INFO_MESSAGES']
1415

1516
if CHECK_OLD_RUBIES
1617
require 'rvm'
@@ -91,6 +92,7 @@ def fixed(txt, line=0)
9192
# Display an info message. Info messages do not alter the exit status.
9293
#
9394
def info(txt, line=0)
95+
return if SUPRESS_INFO_MESSAGES
9496
line_msg = (line>0) ? ":#{line}" : ''
9597
puts "#{@full_filepath}#{line_msg} - [#{'INFO'.cyan}] #{cleanup_text(txt)}"
9698
end
@@ -471,9 +473,12 @@ def check_lines
471473
error("Writes to stdout", idx)
472474
end
473475

474-
# do not change datastore in code
476+
# You should not change datastore in code. For reasons. See
477+
# RM#8498 for discussion, starting at comment #16:
478+
#
479+
# https://dev.metasploit.com/redmine/issues/8498#note-16
475480
if ln =~ /(?<!\.)datastore\[["'][^"']+["']\]\s*=(?![=~>])/
476-
error("datastore is modified in code: #{ln}", idx)
481+
info("datastore is modified in code: #{ln}", idx)
477482
end
478483

479484
# do not read Set-Cookie header (ignore commented lines)

0 commit comments

Comments
 (0)