rework msftidy exit codes

bug/bundler_fix
Christian Mehlmauer 2017-09-15 10:27:04 +02:00
parent 9b5350ff9c
commit 7578913058
No known key found for this signature in database
GPG Key ID: DCF54A05D6E62591
1 changed files with 7 additions and 5 deletions

View File

@ -43,9 +43,10 @@ end
class Msftidy
# Status codes
OK = 0x00
WARNINGS = 0x10
ERRORS = 0x20
OK = 0
INFO = 1
WARNING = 2
ERROR = 3
# Some compiles regexes
REGEX_MSF_EXPLOIT = / \< Msf::Exploit/
@ -73,7 +74,7 @@ class Msftidy
# error.
def warn(txt, line=0) line_msg = (line>0) ? ":#{line}" : ''
puts "#{@full_filepath}#{line_msg} - [#{'WARNING'.yellow}] #{cleanup_text(txt)}"
@status == ERRORS ? @status = ERRORS : @status = WARNINGS
@status += WARNING
end
#
@ -85,7 +86,7 @@ class Msftidy
def error(txt, line=0)
line_msg = (line>0) ? ":#{line}" : ''
puts "#{@full_filepath}#{line_msg} - [#{'ERROR'.red}] #{cleanup_text(txt)}"
@status = ERRORS
@status += ERROR
end
# Currently unused, but some day msftidy will fix errors for you.
@ -101,6 +102,7 @@ class Msftidy
return if SUPPRESS_INFO_MESSAGES
line_msg = (line>0) ? ":#{line}" : ''
puts "#{@full_filepath}#{line_msg} - [#{'INFO'.cyan}] #{cleanup_text(txt)}"
@status += INFO
end
##