File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,34 @@ def error(txt, line=0)
59
59
#
60
60
##
61
61
62
+ def check_old_keywords
63
+ max_count = 10
64
+ counter = 0
65
+ if @source =~ /^##/
66
+ first_line = true
67
+ @source . each_line do |line |
68
+ # If exists, the $Id$ keyword should appear at the top of the code.
69
+ # If not (within the first 10 lines), then we assume there's no
70
+ # $Id$, and then bail.
71
+ break if counter >= max_count
72
+
73
+ if line =~ /^#[[:space:]]*\$ Id\$ /i
74
+ warn ( "Keyword $Id$ is no longer needed." )
75
+ break
76
+ end
77
+
78
+ return if !first_line and line =~ /^##/
79
+ first_line = false
80
+
81
+ counter += 1
82
+ end
83
+ end
84
+
85
+ if @source =~ /'Version'[[:space:]]*=>[[:space:]]*['|"]\$ Revision\$ ['|"]/
86
+ warn ( "Keyword $Revision$ is no longer needed." )
87
+ end
88
+ end
89
+
62
90
def check_badchars
63
91
badchars = %Q|&<=>|
64
92
@@ -299,6 +327,7 @@ def load_file(file)
299
327
300
328
def run_checks ( f_rel )
301
329
tidy = Msftidy . new ( f_rel )
330
+ tidy . check_old_keywords
302
331
tidy . check_badchars
303
332
tidy . check_extname
304
333
tidy . test_old_rubies ( f_rel )
You can’t perform that action at this time.
0 commit comments