We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e806222 commit a279db7Copy full SHA for a279db7
tools/msftidy.rb
@@ -529,6 +529,18 @@ def check_newline_eof
529
end
530
531
532
+ def check_sock_get
533
+ if @source =~ /\s+sock\.get(\s*|\(|\d+\s*|\d+\s*,\d+\s*)/m && @source !~ /sock\.get_once/
534
+ info('Please use sock.get_once instead of sock.get')
535
+ end
536
537
+
538
+ def check_udp_sock_get
539
+ if @source =~ /udp_sock\.get[^\d]+/m
540
+ info('Please specify a timeout to udp_sock.get')
541
542
543
544
private
545
546
def load_file(file)
@@ -574,6 +586,8 @@ def run_checks(full_filepath)
574
586
tidy.check_vuln_codes
575
587
tidy.check_vars_get
576
588
tidy.check_newline_eof
589
+ tidy.check_sock_get
590
+ tidy.check_udp_sock_get
577
591
return tidy
578
592
579
593
0 commit comments