-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnormono.rb
723 lines (664 loc) · 20.1 KB
/
normono.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
#!/usr/bin/ruby
require 'optparse'
require 'tmpdir'
class String
def each_char
split('').each { |i| yield i }
end
def add_style(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
def black
add_style(31)
end
def red
add_style(31)
end
def green
add_style(32)
end
def yellow
add_style(33)
end
def blue
add_style(34)
end
def magenta
add_style(35)
end
def cyan
add_style(36)
end
def grey
add_style(37)
end
def bold
add_style(1)
end
def italic
add_style(3)
end
def underline
add_style(4)
end
end
module FileType
UNKNOWN = 0
DIRECTORY = 1
MAKEFILE = 2
HEADER = 3
SOURCE = 4
end
class FileManager
attr_accessor :path
attr_accessor :type
def initialize(path, type)
@path = path
@type = type
@type = get_file_type if @type == FileType::UNKNOWN
end
def get_file_type
@type = if @path =~ /Makefile$/
FileType::MAKEFILE
elsif @path =~ /[.]h$/
FileType::HEADER
elsif @path =~ /[.]c$/
FileType::SOURCE
else
FileType::UNKNOWN
end
end
def get_content
file = File.open(@path)
content = file.read
file.close
content
end
end
class FilesRetriever
@@ignore = nil
def initialize
@files = Dir['**/*'].select { |f| File.file? f }
@files.delete_if { |f| f =~ /.rb/ }
@files.delete_if { |f| f =~ /.md/ }
@files.delete_if { |f| f =~ /test/ }
@files.delete_if { |f| f =~ /criterion/ }
@files.delete_if { |f| f =~ /Makefile/ }
if File.file?('.gitignore')
line_num = 0
gitignore = FileManager.new('.gitignore', FileType::UNKNOWN).get_content
gitignore.gsub!(/\r\n?/, "\n")
@@ignore = []
gitignore.each_line do |line|
if !line.start_with?('#') && line !~ /^\s*$/
@@ignore.push(line.chomp)
end
end
end
@nb_files = @files.size
@idx_files = 0
@dirs = Dir['**/*'].select { |d| File.directory? d }
@nb_dirs = @dirs.size
@idx_dirs = 0
end
def is_ignored_file(file)
@@ignore.each do |ignored_file|
if file.include?(ignored_file) || file.include?(ignored_file.tr('*', ''))
return true
end
end
false
end
def get_next_file
if @idx_files < @nb_files
file = FileManager.new(@files[@idx_files], FileType::UNKNOWN)
@idx_files += 1
file = get_next_file if !@@ignore.nil? && is_ignored_file(file.path)
return file
elsif @idx_dirs < @nb_dirs
file = FileManager.new(@dirs[@idx_dirs], FileType::DIRECTORY)
@idx_dirs += 1
file = get_next_file if !@@ignore.nil? && is_ignored_file(file.path)
return file
end
nil
end
end
class CodingStyleChecker
def initialize(file_manager)
@file_path = file_manager.path
@type = file_manager.type
@file = nil
if (@type != FileType::UNKNOWN) && (@type != FileType::DIRECTORY)
@file = file_manager.get_content
end
check_file
end
def check_file
if @type == FileType::UNKNOWN
unless $options.include? :ignorefiles
msg_brackets = '[' + @file_path + ']'
msg_error = ' Forbidden or useless file.'
puts(msg_brackets.bold.red + msg_error.bold)
end
return
end
if @type == FileType::DIRECTORY
check_dirname
return
end
check_trailing_spaces_tabs
check_spaces_in_indentation
if @type != FileType::MAKEFILE
check_filename
check_too_many_columns
check_too_broad_filename
# check_header
check_several_assignments
# check_forbidden_keyword_func
check_too_many_else_if
check_empty_parenthesis
check_too_many_parameters
check_space_after_keywords
check_misplaced_pointer_symbol
check_comma_missing_space
check_misplaced_comments
check_operators_spaces
check_condition_assignment
if @type == FileType::SOURCE
check_functions_per_file
check_function_lines
check_empty_line_between_functions
end
check_macro_used_as_constant if @type == FileType::HEADER
elsif @type == FileType::MAKEFILE
# check_header_makefile
end
end
def check_dirname
filename = File.basename(@file_path)
if filename !~ /^[a-z0-9]+([a-z0-9_]+[a-z0-9]+)*$/
msg_brackets = '[' + @file_path + ']'
msg_error = ' Directory name does not respect snake_case.'
puts(msg_brackets.bold.red + msg_error.bold)
end
end
def check_filename
filename = File.basename(@file_path)
if filename !~ /^[a-z0-9]+([a-z0-9_]+[a-z0-9]+)*[.][ch]$/
msg_brackets = '[' + @file_path + ']'
msg_error = ' Filename does not respect snake_case.'
puts(msg_brackets.bold.red + msg_error.bold)
end
end
def check_too_many_columns
line_nb = 1
@file.each_line do |line|
length = 0
line.each_char do |char|
length += if char == "\t"
8
else
1
end
end
if length - 1 > 80
msg_brackets = '[' + @file_path + ': L' + line_nb.to_s + ']'
msg_error = ' Too many columns (' + (length - 1).to_s + ' > 80).'
puts(msg_brackets.bold.red + msg_error.bold)
end
line_nb += 1
end
end
def check_too_broad_filename
if @file_path =~ /(.*\/|^)(string.c|str.c|my_string.c|my_str.c|algorithm.c|my_algorithm.c|algo.c|my_algo.c|program.c|my_program.c|prog.c|my_prog.c)$/
msg_brackets = '[' + @file_path + ']'
msg_error = ' Too broad filename. You should rename this file.'
puts(msg_brackets.bold.red + msg_error.bold)
end
end
def check_header
if @file !~ /\/\*\n\*\* EPITECH PROJECT, [0-9]{4}\n\*\* .*\n\*\* File description:\n(\*\* .*\n)+\*\/\n.*/
msg_brackets = '[' + @file_path + ']'
msg_error = ' Missing or corrupted header.'
puts(msg_brackets.bold.red + msg_error.bold)
end
end
def check_function_lines
count = level = 0
line_nb = function_start = 1
@file.each_line do |line|
if line =~ /{[ \t]*$/
if level == 0
function_start = line_nb
count = -1
end
level += 1
elsif line =~ /^[ \t]*}[ \t]*$/
level -= 1
if (level == 0) && (count > 20)
msg_brackets = '[' + @file_path + ':' + function_start.to_s + ']'
msg_error = ' More than 20 lines (' + count.to_s + ' > 20).'
puts(msg_brackets.bold.red + msg_error.bold)
end
end
count += 1
line_nb += 1
end
end
def check_several_assignments
line_nb = 1
@file.each_line do |line|
if line =~ /^[ \t]*for ?\(/
line_nb += 1
next
end
assignments = 0
line.each_char do |char|
assignments += 1 if char == ';'
end
if assignments > 1
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = ' Several assignments on the same line.'
puts(msg_brackets.bold.red + msg_error.bold)
end
line_nb += 1
end
end
def check_forbidden_keyword_func
line_nb = 1
@file.each_line do |line|
line.scan(/(^|[^0-9a-zA-Z_])(printf|dprintf|fprintf|vprintf|sprintf|snprintf|vprintf|vfprintf|vsprintf|vsnprintf|asprintf|scranf|memcpy|memset|memmove|strcat|strchar|strcpy|atoi|strlen|strstr|strncat|strncpy|strcasestr|strncasestr|strcmp|strncmp|strtok|strnlen|strdup|realloc)[^0-9a-zA-Z]/) do
unless $options.include? :ignorefunctions
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = " Function may be forbidden: '".bold
msg_error += Regexp.last_match(2).bold.red
msg_error += "'?".bold
puts(msg_brackets.bold.red + msg_error)
end
end
line.scan(/(^|[^0-9a-zA-Z_])(goto)[^0-9a-zA-Z]/) do
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = " Keyword may be forbidden: '".bold
msg_error += Regexp.last_match(2).bold.red
msg_error += "'?".bold
puts(msg_brackets.bold.red + msg_error)
end
line_nb += 1
end
end
def check_too_many_else_if
line_nb = condition_start = 1
count = 0
@file.each_line do |line|
line[0] = '' while [' ', "\t"].include?(line[0])
if line =~ /^if ?\(/
condition_start = line_nb
count = 1
elsif line =~ /^else if ?\(/ || line =~ /^else ?\(/
count += 1
if count > 3
msg_brackets = '[' + @file_path + ':' + condition_start.to_s + ']'
msg_error = ' Too many "else if".'
puts(msg_brackets.bold.green + msg_error.bold)
end
end
line_nb += 1
end
end
def check_trailing_spaces_tabs
line_nb = 1
@file.each_line do |line|
if line =~ / $/
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = ' Trailing space, end of the line.'
puts(msg_brackets.bold.green + msg_error.bold)
elsif line =~ /\t$/
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = ' Trailing tab(s), end of the line.'
puts(msg_brackets.bold.green + msg_error.bold)
end
line_nb += 1
end
end
def check_spaces_in_indentation
line_nb = 1
@file.each_line do |line|
if line =~ /^\/\**/ # skip block comment start
line_nb += 1
next
elsif line =~ /^*\*\// # skip block comment end
line_nb += 1
next
elsif line =~ /^\/\/*/ # skip comment
line_nb += 1
next
elsif line =~ /^ \**/ # skip doxygen lines
line_nb += 1
next
end
indent = 0
while line[indent] == " "
indent += 1
end
if indent % 4 != 0
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = ' Wrong indentation.'
puts(msg_brackets.bold.green + msg_error.bold)
end
line_nb += 1
end
end
def check_functions_per_file
functions = 0
@file.each_line do |line|
functions += 1 if line =~ /^{/
end
if functions > 5
msg_brackets = '[' + @file_path + ']'
msg_error = ' More than 5 functions (' + functions.to_s + ' > 5).'
puts(msg_brackets.bold.red + msg_error.bold)
end
end
def check_empty_parenthesis
line_nb = 1
missing_bracket = false
@file.each_line do |line|
if missing_bracket
if line =~ /^{$/
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = " No-parameter function should take void as argument."
puts(msg_brackets.bold.red + msg_error.bold)
elsif line !~ /^[\t ]*$/
missing_bracket = false
end
elsif line =~ /\(\)[\t ]*{$/
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = " No-parameter function should take void as argument."
puts(msg_brackets.bold.red + msg_error.bold)
elsif line =~ /\(\)[ \t]*$/
missing_bracket = true
end
line_nb += 1
end
end
def check_too_many_parameters
@file.scan(/\(([^(),]*,){4,}[^()]*\)[ \t\n]+{/).each do |_match|
msg_brackets = '[' + @file_path + ']'
msg_error = " Function takes more than 4 arguments."
puts(msg_brackets.bold.red + msg_error.bold)
end
end
def check_space_after_keywords
line_nb = 1
@file.each_line do |line|
line.scan(/(return|if|else if|else|while|for)\(/) do |match|
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = " Missing space after '" + match[0] + "'."
puts(msg_brackets.bold.green + msg_error.bold)
end
line_nb += 1
end
end
def check_misplaced_pointer_symbol
line_nb = 1
@file.each_line do |line|
if line =~ /^ \**/ # skip doxygen lines
line_nb += 1
next
end
line.scan(/([^(\t ]+_t|int|signed|unsigned|char|long|short|float|double|void|const|struct [^ ]+)\*/) do |match|
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = " Misplaced pointer symbol after '" + match[0] + "'."
puts(msg_brackets.bold.green + msg_error.bold)
end
line_nb += 1
end
end
def check_macro_used_as_constant
line_nb = 1
@file.each_line do |line|
if line =~ /#define [^ ]+ [0-9]+([.][0-9]+)?/
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = ' Macros should not be used for constants.'
puts(msg_brackets.bold.green + msg_error.bold)
end
line_nb += 1
end
end
def check_header_makefile
if @file !~ /##\n## EPITECH PROJECT, [0-9]{4}\n## .*\n## File description:\n## .*\n##\n.*/
msg_brackets = '[' + @file_path + ']'
msg_error = ' Missing or corrupted header.'
puts(msg_brackets.bold.red + msg_error.bold)
end
end
def check_misplaced_comments
level = 0
line_nb = 1
@file.each_line do |line|
level += line.count '{'
level -= line.count '}'
if (level != 0) && (line =~ /\/\*/ || line =~ /\/\//)
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = ' Comment in the code.'
puts(msg_brackets.bold.green + msg_error.bold)
end
line_nb += 1
end
end
def check_comma_missing_space
line_nb = 1
@file.each_line do |line|
line.scan(/,[^ \n]/) do
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = ' Missing space after comma.'
puts(msg_brackets.bold.green + msg_error.bold)
end
line_nb += 1
end
end
def put_error_sign(sign, line_nb)
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = " Misplaced space(s) around '" + sign + "' sign."
puts(msg_brackets.bold.green + msg_error.bold)
end
def check_operators_spaces
line_nb = 1
@file.each_line do |line|
# A space on both ends
line.scan(/([^\t&|=^><+\-*%\/! ]=[^=]|[^&|=^><+\-*%\/!]=[^= \n])/) do
put_error_sign('=', line_nb)
end
line.scan(/([^\t ]==|==[^ \n])/) do
put_error_sign('==', line_nb)
end
line.scan(/([^\t ]!=|!=[^ \n])/) do
put_error_sign('!=', line_nb)
end
line.scan(/([^\t <]<=|[^<]<=[^ \n])/) do
put_error_sign('<=', line_nb)
end
line.scan(/([^\t >]>=|[^>]>=[^ \n])/) do
put_error_sign('>=', line_nb)
end
line.scan(/([^\t ]&&|&&[^ \n])/) do
put_error_sign('&&', line_nb)
end
line.scan(/([^\t ]\|\||\|\|[^ \n])/) do
put_error_sign('||', line_nb)
end
line.scan(/([^\t ]\+=|\+=[^ \n])/) do
put_error_sign('+=', line_nb)
end
line.scan(/([^\t ]-=|-=[^ \n])/) do
put_error_sign('-=', line_nb)
end
line.scan(/([^\t ]\*=|\*=[^ \n])/) do
put_error_sign('*=', line_nb)
end
line.scan(/([^\t ]\/=|\/=[^ \n])/) do
put_error_sign('/=', line_nb)
end
line.scan(/([^\t ]%=|%=[^ \n])/) do
put_error_sign('%=', line_nb)
end
line.scan(/([^\t ]&=|&=[^ \n])/) do
put_error_sign('&=', line_nb)
end
line.scan(/([^\t ]\^=|\^=[^ \n])/) do
put_error_sign('^=', line_nb)
end
line.scan(/([^\t ]\|=|\|=[^ \n])/) do
put_error_sign('|=', line_nb)
end
line.scan(/([^\t |]\|[^|]|[^|]\|[^ =|\n])/) do
# Minifix for Matchstick
line.scan(/([^']\|[^'])/) do
put_error_sign('|', line_nb)
end
end
line.scan(/([^\t ]\^|\^[^ =\n])/) do
put_error_sign('^', line_nb)
end
line.scan(/([^\t ]>>[^=]|>>[^ =\n])/) do
put_error_sign('>>', line_nb)
end
line.scan(/([^\t ]<<[^=]|<<[^ =\n])/) do
put_error_sign('<<', line_nb)
end
line.scan(/([^\t ]>>=|>>=[^ \n])/) do
put_error_sign('>>=', line_nb)
end
line.scan(/([^\t ]<<=|<<=[^ \n])/) do
put_error_sign('<<=', line_nb)
end
# No space after
line.scan(/([^!]! )/) do
put_error_sign('!', line_nb)
end
line.scan(/([^a-zA-Z0-9]sizeof )/) do
put_error_sign('sizeof', line_nb)
end
line.scan(/([^a-zA-Z)\]]\+\+[^(\[*a-zA-Z])/) do
put_error_sign('++', line_nb)
end
line.scan(/([^a-zA-Z)\]]--[^\[(*a-zA-Z])/) do
put_error_sign('--', line_nb)
end
line_nb += 1
end
end
def check_condition_assignment
line_nb = 1
@file.each_line do |line|
line.scan(/(if.*[^&|=^><+\-*%\/!]=[^=].*==.*)|(if.*==.*[^&|=^><+\-*%\/!]=[^=].*)/) do
msg_brackets = '[' + @file_path + ':' + line_nb.to_s + ']'
msg_error = ' Condition and assignment on the same line.'
puts(msg_brackets.bold.green + msg_error.bold)
end
line_nb += 1
end
end
def check_empty_line_between_functions
@file.scan(/\n{3,}^[^ \n\t]+ [^ \n\t]+\([^\n\t]*\)/).each do |_match|
msg_brackets = '[' + @file_path + ']'
msg_error = ' Empty lines between functions.'
puts(msg_brackets.bold.green + msg_error.bold)
end
@file.scan(/[^\n]\n^[^ \n\t]+ [^ \n\t]+\([^\n\t]*\)/).each do |_match|
/ msg_brackets = '[' + @file_path + ']'
msg_error = ' Missing empty line between functions.'
puts(msg_brackets.bold.green + msg_error.bold)
/ end
end
end
class UpdateManager
def initialize(script_path)
path = File.dirname(script_path)
tmp_dir = Dir.tmpdir
@script_path = script_path
@remote_path = "#{tmp_dir}/__normez_remote"
@backup_path = "#{tmp_dir}/__normez_backup"
@remote = system("curl -s https://raw.githubusercontent.com/ronanboiteau/NormEZ/master/NormEZ.rb > #{@remote_path}")
end
def clean_update_files
system("rm -rf #{@backup_path}")
system("rm -rf #{@remote_path}")
end
def can_update
unless @remote
clean_update_files
return false
end
@current = `cat #{@script_path} | grep 'NormEZ_v' | cut -c 11- | head -1 | tr -d '.'`
@latest = `cat #{@remote_path} | grep 'NormEZ_v' | cut -c 11- | head -1 | tr -d '.'`
@latest_disp = `cat #{@remote_path} | grep 'NormEZ_v' | cut -c 11- | head -1`
return true if @current < @latest
clean_update_files
false
end
def update
if @current < @latest
update_msg = `cat #{@remote_path} | grep 'Changelog: ' | cut -c 14- | head -1 | tr -d '.'`
print("A new version is available: Norminette v#{@latest_disp}".bold.yellow)
print(' => Changelog: '.bold)
print(update_msg.to_s.bold.blue)
response = nil
Kernel.loop do
print('Update NormEZ? [Y/n]: ')
response = gets.chomp
break if ['N', 'n', 'no', 'Y', 'y', 'yes', ''].include?(response)
end
if %w[N n no].include?(response)
puts('Update skipped. You can also use the --no-update (or -u) option to prevent auto-updating.'.bold.blue)
clean_update_files
return
end
puts('Downloading update...')
system("cat #{@script_path} > #{@backup_path}")
exit_code = system("cat #{@remote_path} > #{@script_path}")
unless exit_code
print('Error while updating! Cancelling...'.bold.red)
system("cat #{@backup_path} > #{@script_path}")
clean_update_files
Kernel.exit(false)
end
clean_update_files
puts('NormEZ has been successfully updated!'.bold.green)
Kernel.exit(true)
end
end
end
$options = {}
opt_parser = OptionParser.new do |opts|
opts.banner = 'Usage: `ruby ' + $PROGRAM_NAME + ' [-ufmi]`'
opts.on('-u', '--no-update', "Don't check for updates") do |o|
$options[:noupdate] = o
end
opts.on('-f', '--ignore-files', 'Ignore forbidden files') do |o|
$options[:ignorefiles] = o
end
opts.on('-m', '--ignore-functions', 'Ignore forbidden functions') do |o|
$options[:ignorefunctions] = o
end
opts.on('-i', '--ignore-all', 'Ignore forbidden files & forbidden functions (same as `-fm`)') do |o|
$options[:ignorefiles] = o
$options[:ignorefunctions] = o
end
end
begin
opt_parser.parse!
rescue OptionParser::InvalidOption => e
puts('Error: ' + e.to_s)
puts(opt_parser.banner)
Kernel.exit(false)
end
unless $options.include?(:noupdate)
updater = UpdateManager.new($PROGRAM_NAME)
updater.update if updater.can_update
end
files_retriever = FilesRetriever.new
while (next_file = files_retriever.get_next_file)
CodingStyleChecker.new(next_file)
end