File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -536,7 +536,7 @@ def check_lines
536
536
# RM#8498 for discussion, starting at comment #16:
537
537
#
538
538
# https://dev.metasploit.com/redmine/issues/8498#note-16
539
- if ln =~ /(?<!\. )datastore\[ ["'][^"']+["']\] \s *= (?![=~>])/
539
+ if ln =~ /(?<!\. )datastore\[ ["'][^"']+["']\] \s *(=|<<) (?![=~>])/
540
540
info ( "datastore is modified in code: #{ ln } " , idx )
541
541
end
542
542
@@ -549,6 +549,10 @@ def check_lines
549
549
if ln =~ /^\s *Rank\s *=\s */ and @source =~ /<\s Msf::Auxiliary/
550
550
warn ( "Auxiliary modules have no 'Rank': #{ ln } " , idx )
551
551
end
552
+
553
+ if ln =~ /^\s *def\s +(?:[^\( \) ]*[A-Z]+[^\( \) ]*)(?:\( .*\) )?$/
554
+ warn ( "Please use snake case on method names: #{ ln } " , idx )
555
+ end
552
556
end
553
557
end
554
558
@@ -586,6 +590,15 @@ def check_udp_sock_get
586
590
end
587
591
end
588
592
593
+ def check_invalid_url_scheme
594
+ test = @source . scan ( /^.+http\/ \/ .+$/ )
595
+ unless test . empty?
596
+ test . each { |item |
597
+ info ( "Invalid URL: #{ item } " )
598
+ }
599
+ end
600
+ end
601
+
589
602
private
590
603
591
604
def load_file ( file )
@@ -634,6 +647,7 @@ def run_checks(full_filepath)
634
647
tidy . check_newline_eof
635
648
tidy . check_sock_get
636
649
tidy . check_udp_sock_get
650
+ tidy . check_invalid_url_scheme
637
651
return tidy
638
652
end
639
653
You can’t perform that action at this time.
0 commit comments