Skip to content

Commit 37efe53

Browse files
committed
I hope this works better
1 parent a8084d6 commit 37efe53

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

tools/msftidy.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ def initialize(source_file)
3636

3737
##
3838
#
39-
# The following two functions only print what you throw at them.
40-
# With an option of displaying the line number.
39+
# The following two functions only print what you throw at them,
40+
# with the option of displying the line number. error() is meant
41+
# for mistakes that might actually break something.
4142
#
4243
##
4344

@@ -61,21 +62,22 @@ def error(txt, line=0)
6162
def check_badchars
6263
badchars = %Q|&<=>|
6364

64-
in_super = false
65-
in_author = false
65+
in_super = false
66+
in_author = false
67+
is_text = false
68+
is_comment = false
6669

67-
# First off, we need to capture the "super()" code block.
68-
# That's where we want to check our badchars.
6970
@source.each_line do |line|
7071
#
7172
# Mark our "super" code block
7273
#
73-
if !in_super and line =~ /[\n\t]+super\(/
74+
if line =~ /^#/ or line =~ /^=begin/
75+
next
76+
elsif !in_super and line =~ /[\n\t]+super\(/
7477
in_super = true
75-
elsif in_super and line =~ /(.+)\)\n/
76-
if $1 !~ /#/
77-
in_super = false
78-
end
78+
elsif in_super and line =~ /[[:space:]]*def \w+[\(\w+\)]*/
79+
in_super = false
80+
break
7981
end
8082

8183
#
@@ -193,7 +195,7 @@ def check_title_format
193195
[words.first, words.last].each do |word|
194196
if word[0,1] =~ /[a-z]/ and word[1,1] !~ /[A-Z0-9]/
195197
next if word =~ /php[A-Z]/
196-
next if %w{iseemedia activePDF freeFTPd osCommerce myBB qdPM}.include? word
198+
next if %w{iseemedia activePDF freeFTPd osCommerce myBB qdPM inetd wallet.dat}.include? word
197199
warn("Improper capitalization in module title: '#{word}...'")
198200
end
199201
end

0 commit comments

Comments
 (0)