File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,10 @@ def ascii_only?
43
43
class Msftidy
44
44
45
45
# Status codes
46
- OK = 0x00
47
- WARNINGS = 0x10
48
- ERRORS = 0x20
46
+ OK = 0
47
+ INFO = 1
48
+ WARNING = 2
49
+ ERROR = 3
49
50
50
51
# Some compiles regexes
51
52
REGEX_MSF_EXPLOIT = / \< Msf::Exploit/
@@ -73,7 +74,7 @@ def initialize(source_file)
73
74
# error.
74
75
def warn ( txt , line = 0 ) line_msg = ( line >0 ) ? ":#{ line } " : ''
75
76
puts "#{ @full_filepath } #{ line_msg } - [#{ 'WARNING' . yellow } ] #{ cleanup_text ( txt ) } "
76
- @status == ERRORS ? @status = ERRORS : @status = WARNINGS
77
+ @status += WARNING
77
78
end
78
79
79
80
#
@@ -85,7 +86,7 @@ def warn(txt, line=0) line_msg = (line>0) ? ":#{line}" : ''
85
86
def error ( txt , line = 0 )
86
87
line_msg = ( line >0 ) ? ":#{ line } " : ''
87
88
puts "#{ @full_filepath } #{ line_msg } - [#{ 'ERROR' . red } ] #{ cleanup_text ( txt ) } "
88
- @status = ERRORS
89
+ @status += ERROR
89
90
end
90
91
91
92
# Currently unused, but some day msftidy will fix errors for you.
@@ -101,6 +102,7 @@ def info(txt, line=0)
101
102
return if SUPPRESS_INFO_MESSAGES
102
103
line_msg = ( line >0 ) ? ":#{ line } " : ''
103
104
puts "#{ @full_filepath } #{ line_msg } - [#{ 'INFO' . cyan } ] #{ cleanup_text ( txt ) } "
105
+ @status += INFO
104
106
end
105
107
106
108
##
You can’t perform that action at this time.
0 commit comments