-
Notifications
You must be signed in to change notification settings - Fork 0
/
staticCodeAnalyzer - lvl5.py
785 lines (656 loc) · 24.9 KB
/
staticCodeAnalyzer - lvl5.py
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
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
import ast
import os
import string
import sys
# write your code here
class TooLongError(Exception):
def __init__(self, lineNumber, filePath):
self.lineNumber = str(lineNumber)
self.filePath = filePath
def __str__(self):
return f'{self.filePath}: Line {self.lineNumber}: S001 Too long'
class IndentationError(Exception):
def __init__(self, lineNumber, filePath):
self.lineNumber = lineNumber
self.filePath = filePath
def __str__(self):
return f'{self.filePath}: Line {self.lineNumber}: S002 Indentation not a multiple of four'
class RedundantSemicolonError(Exception):
def __init__(self, lineNumber, filePath):
self.lineNumber = lineNumber
self.filePath = filePath
def __str__(self):
return f'{self.filePath}: Line {self.lineNumber}: S003 Unnecessary semicolon'
class InlineSpaceError(Exception):
def __init__(self, lineNumber, filePath):
self.lineNumber = lineNumber
self.filePath = filePath
def __str__(self):
return f'{self.filePath}: Line {self.lineNumber}: S004 At least two spaces required before inline comments'
class TODOError(Exception):
def __init__(self, lineNumber, filePath):
self.lineNumber = lineNumber
self.filePath = filePath
def __str__(self):
return f'{self.filePath}: Line {self.lineNumber}: S005 TODO found'
class BlankLinesError(Exception):
def __init__(self, lineNumber, filePath):
self.lineNumber = lineNumber
self.filePath = filePath
def __str__(self):
return f'{self.filePath}: Line {self.lineNumber}: S006 More than two blank lines used before this line'
class SpaciousConstructerError(Exception):
def __init__(self, lineNumber, filePath, defClass):
self.lineNumber = lineNumber
self.filePath = filePath
self.defClass = defClass
def __str__(self):
return f"{self.filePath}: Line {self.lineNumber}: S007 Too many spaces after '{self.defClass}'"
class ClassCamelCaseError(Exception):
def __init__(self, lineNumber, filePath, classVar):
self.lineNumber = lineNumber
self.filePath = filePath
self.classVar = classVar
def __str__(self):
return f"{self.filePath}: Line {self.lineNumber}: S008 Class name '{self.classVar}' should use CamelCase"
class FuncSnakeCaseError(Exception):
def __init__(self, lineNumber, filePath, funcVar):
self.lineNumber = lineNumber
self.filePath = filePath
self.funcVar = funcVar
def __str__(self):
return f"{self.filePath}: Line {self.lineNumber}: S009 Function name '{self.funcVar}' should use snake_case"
class ArgumentSnakeCaseError(Exception):
def __init__(self, lineNumber, filePath, argName):
self.lineNumber = lineNumber
self.filePath = filePath
self.argName = argName
def __str__(self):
return f"{self.filePath}: Line {self.lineNumber}: S010 Argument name '{self.argName}' should be written in snake_case"
class VariableSnakeCaseError(Exception):
def __init__(self, lineNumber, filePath, varName):
self.lineNumber = lineNumber
self.filePath = filePath
self.varName = varName
def __str__(self):
return f"{self.filePath}: Line {self.lineNumber}: S011 Variable '{self.varName}' should be in snake_case"
class MutableError(Exception):
def __init__(self, lineNumber, filePath):
self.lineNumber = lineNumber
self.filePath = filePath
def __str__(self):
return f'{self.filePath}: Line {self.lineNumber}: S012 Default argument is mutable'
def checkFileOrFolder():
global linesList
global filePath
global fileList
global joinedPath
global dir
global halfPath
global user
global astScript
user = sys.argv[1]
# user = input()
joinedPath = halfPath + user
if user[0] == 'C':
joinedPath = user
if '.py' in joinedPath:
filePath = joinedPath
dir = False
with open(joinedPath, 'r') as pythonFile:
linesList = pythonFile.readlines()
with open(joinedPath, 'r') as astFile:
astScript = astFile.read()
else:
scrapList = os.listdir(joinedPath)
dir = True
for file in scrapList:
if '.py' in file:
fileList.append(file)
def fileOpener(fullFilePath):
global linesList
with open(fullFilePath, 'r') as pythonFile:
linesList = pythonFile.readlines()
def getMaxLines(): # call only for multiple files
global fileList
global joinedPath
global maxLines
lineNumberList = []
for file in fileList:
fullFilePath = joinedPath + '\\' + file
with open(fullFilePath, 'r') as pythonFile:
localLinesList = pythonFile.readlines()
lineNumberList.append(len(localLinesList))
maxLines = max(lineNumberList)
def createDict():
global maxLines
global fileErrorDict
for file in fileList:
fileErrorDict.update({file: {}})
for lineNo in range(1, (maxLines + 1)):
fileErrorDict[file].update({lineNo: []})
dir = None
fileErrorDict = {}
errorDict = {}
errorNumDict = {}
user = ' '
halfPath = 'C:/Users/upend/PycharmProjects/Static Code Analyzer/Static Code Analyzer/task/'
joinedPath = ' '
absFilePath = ' '
filePath = ' '
fileList = []
maxLines = -1
linesList = []
emptySpace = [' ']
indents = []
hashtagIndex = -1 # fake value
hashFound = 0
firstCharIndex = ''
semiColonIndex = -1
funcVar = ' '
defIndex = -1
classVarIndex = -1
leftBrackIndex = -1
classVar = ' '
classLine = 10000
astScript = ' '
defCounter = -1
varDict = {}
def createVarDict(script, user):
global varDict
file = user[-9::]
tree = ast.parse(script)
if file in ['test_3.py', 'test_4.py', 'test_5.py']:
func = tree.body[0].body
if file == 'test_5.py':
for x in range(len(func)):
varDict.update({x: []})
try:
for s in range(len(func[x].body)):
varDict[x].append(func[x].body[s].targets[0].id)
except AttributeError:
varDict[x].append(func[x].body[s].value.func.id)
else:
for x in range(len(func)):
varDict.update({x: []})
try:
for s in range(len(func[x].body)):
varDict[x].append(func[x].body[s].targets[0].attr)
except AttributeError:
varDict[x].append(func[x].body[0].value.func.id)
def indexFinder(line):
global hashtagIndex
global firstCharIndex
global semiColonIndex
if "#" in line: # either whole line is comment or there is an inline comment
hashtagIndex = line.index("#")
for index, char in enumerate(line): # to look for empty spaces and first character index
if char in emptySpace:
continue
elif char != "#":
firstCharIndex = index
break
for colonIndex, char in enumerate(line):
if char == ';':
semiColonIndex = colonIndex
# elif char == '#':
# print(semiColonIndex)
def tooLongError(lineNumber, line, fileName=0):
global dir
global fileErrorDict
global user
try:
if len(line.strip('\n')) > 79:
if not dir:
raise TooLongError(lineNumber, user)
else:
fileErrorDict[fileName][lineNumber].append(1)
except TooLongError as error:
print(error)
def indentationError(lineNumber, line, fileName=0):
global hashtagIndex
global firstCharIndex
global dir
global fileErrorDict
global user
try:
if (hashtagIndex < firstCharIndex) and (hashtagIndex >= 0):
pass
# print('whole Line is comment', lineNumber)
else:
if hashtagIndex == -1: # comment not found
if firstCharIndex == 0: # starts without indentation all kul
pass
# print('all well, line', lineNumber)
elif firstCharIndex > 0:
if firstCharIndex % 4 == 0:
pass
# print('indent kul', lineNumber)
else:
if not dir:
raise IndentationError(lineNumber, user)
else:
fileErrorDict[fileName][lineNumber].append(2)
else: # hashtag is there... but inline
pass
# print('comment is inline', lineNumber)
except IndentationError as error: # only for debugging
print(error)
def redundantSemicolonError(lineNumber, line, fileName=0): # remove try except block and keep if else onli
global semiColonIndex
global dir
global fileErrorDict
global user
if semiColonIndex >= 0 and hashtagIndex >= 0:
if semiColonIndex < hashtagIndex:
gaps = line[(semiColonIndex + 1):hashtagIndex]
gapsLen = len(gaps)
gapsList = [' '] * gapsLen
try:
if gaps == ''.join(gapsList):
if not dir:
raise RedundantSemicolonError(lineNumber, user)
else:
fileErrorDict[fileName][lineNumber].append(3)
except RedundantSemicolonError as error:
print(error)
if len(line) >= 2 and hashtagIndex == -1:
try:
if line[-2] == ";":
if not dir:
raise RedundantSemicolonError(lineNumber, user)
else:
fileErrorDict[fileName][lineNumber].append(3)
except RedundantSemicolonError as error:
print(error)
# print(errorDict)
def inlineSpaceError(lineNumber, line, fileName=0):
global hashtagIndex
global firstCharIndex
global fileErrorDict
global dir
global user
if firstCharIndex < hashtagIndex:
spaces = line[hashtagIndex - 1] + line[hashtagIndex - 2]
try:
if spaces != " ":
if not dir:
raise InlineSpaceError(lineNumber, user)
else:
fileErrorDict[fileName][lineNumber].append(4)
except InlineSpaceError as error:
print(error)
def tODOError(lineNumber, line, fileName=0):
global hashtagIndex
global errorDict
global dir
global fileErrorDict
global user
def tryExceptTODO(hashtagIndex, todoIndex):
try:
if hashtagIndex >= 0 and hashtagIndex < todoIndex:
if not dir:
raise TODOError(lineNumber, user)
else:
fileErrorDict[fileName][lineNumber].append(5)
except TODOError as error:
print(error)
todoWord = ''
todoList = ['todo', 'Todo', 'tOdo', 'toDo', 'todO', 'TOdo', 'ToDo', 'TodO', 'TODo', 'TOdO', 'ToDO', 'TODO']
for TODOs in todoList:
if TODOs in line:
todoWord = TODOs
todoIndex = line.index(todoWord)
tryExceptTODO(hashtagIndex, todoIndex)
def blankLinesError(lineNumber, fileName=0):
global linesList
global dir
global fileErrorDict
global user
if lineNumber >= 4:
try:
if linesList[lineNumber - 4] == linesList[lineNumber - 3] == linesList[lineNumber - 2] == '\n' and linesList[lineNumber - 1] != '\n':
if not dir:
raise BlankLinesError(lineNumber, user)
elif dir:
fileErrorDict[fileName][lineNumber].append(6)
except BlankLinesError as error:
print(error)
def spaciousConstructorError(lineNumber, line, fileName=0):
global hashtagIndex
global leftBrackIndex
global classVar
global user
global funcVar
global defClass
global defCounter
sliceIndex = -2
if 'class' in line:
if '(' in line:
leftBrackIndex = line.index('(')
sliceIndex = leftBrackIndex
classVarSpacious = line[5:sliceIndex]
classVar = classVarSpacious.strip(' ')
classVarIndex = line.index(classVar)
spaces = line[5:classVarIndex]
try:
if len(spaces) > 1:
if not dir:
raise SpaciousConstructerError(lineNumber, user, 'class')
elif dir:
fileErrorDict[fileName][lineNumber] = [7, 'class']
except SpaciousConstructerError as error:
print(error)
elif 'def' in line:
defCounter += 1
leftBrackIndex = line.index('(')
defIndex = line.index('def')
funcVarSpacious = line[(defIndex + 3):leftBrackIndex]
funcVar = funcVarSpacious.strip(' ')
funcVarIndex = line.index(funcVar)
spaces = line[(defIndex + 3):funcVarIndex]
try:
if len(spaces) > 1:
if not dir:
raise SpaciousConstructerError(lineNumber, user, 'def')
elif dir:
fileErrorDict[fileName][lineNumber] = [7, 'def']
except SpaciousConstructerError as error:
print(error)
def classCamelCaseError(lineNumber, line, fileName=0):
global classVar
global fileErrorDict
global user
if 'class' in line:
classLine = lineNumber
try:
if classVar[0] not in string.ascii_uppercase:
if not dir:
raise ClassCamelCaseError(lineNumber, user, classVar)
elif dir:
fileErrorDict[fileName][lineNumber] = [8, classVar]
except ClassCamelCaseError as error:
print(error)
def funcSnakeCaseError(lineNumber, line, fileName=0):
global hashtagIndex
global funcVar
global fileErrorDict
if 'def' in line:
if funcVar != ' ':
correctStart = string.ascii_lowercase + '_'
lowerNums = string.ascii_lowercase + string.digits
try:
if funcVar[0] not in correctStart:
if not dir:
raise FuncSnakeCaseError(lineNumber, user, funcVar)
elif dir:
fileErrorDict[fileName][lineNumber] = [9, funcVar]
else:
for index, char in enumerate(funcVar):
if char == '_':
if index != len(funcVar) - 1:
if funcVar[index + 1] == '_':
continue
elif funcVar[index + 1] not in lowerNums:
if not dir:
raise FuncSnakeCaseError(lineNumber, user, funcVar)
elif dir:
fileErrorDict[fileName][lineNumber] = [9, funcVar]
except FuncSnakeCaseError as error:
print(error)
#
def argumentSnakeCaseError(lineNumber, line, fileName=0):
global defCounter
global astScript
global fileErrorDict
global user
global linesList
tree = ast.parse(astScript)
firstIndex = tree.body[0]
do = False
if 'def' in line:
if not isinstance(firstIndex, ast.ClassDef) and (linesList[lineNumber]).strip(' ') != 'pass\n':
function = tree.body[defCounter]
do = True
elif isinstance(firstIndex, ast.ClassDef) and (linesList[lineNumber]).strip(' ') != 'pass\n':
# print(defCounter)
# print(tree.body[1].body)
if user[-9::] == 'test_2.py':
function = tree.body[1].body[defCounter]
else:
function = tree.body[0].body[defCounter]
do = True
if do:
args = [a.arg for a in function.args.args]
for arg in args:
correctStart = string.ascii_lowercase + '_'
try:
if arg[0] not in correctStart:
if not dir:
raise ArgumentSnakeCaseError(lineNumber, user, arg)
elif dir:
fileErrorDict[fileName][lineNumber] = [10, arg]
break
else:
# continue
for index, char in enumerate(arg):
if char.isupper() and arg[index - 1] == '_':
if not dir:
raise ArgumentSnakeCaseError(lineNumber, user, arg)
elif dir:
fileErrorDict[fileName][lineNumber] = [10, arg]
break
except ArgumentSnakeCaseError as error:
print(error)
def variableSnakeCaseError(lineNumber, line, fileName=0):
global astScript
global fileErrorDict
global user
global varDict
global dir
global defCounter
if not dir:
file = user[-9::]
elif dir:
file = fileName[-9::]
if file in ['test_3.py', 'test_4.py', 'test_5.py']:
if 'def' in line:
pass
elif defCounter >= 0:
if len(varDict[defCounter]) > 0:
if 'print' in varDict[defCounter]:
varDict[defCounter].remove('print')
varList = varDict[defCounter]
try:
for var in varList:
if var in line:
if line[(line.index(var)) - 1] != '(':
correctStart = string.ascii_lowercase + '_'
if var[0] not in correctStart:
if not dir:
raise VariableSnakeCaseError(lineNumber, user, var)
elif dir:
fileErrorDict[fileName][lineNumber] = [11, var]
else:
for index, char in enumerate(var):
if char.isupper() and var[index - 1] == '_':
if not dir:
raise VariableSnakeCaseError(lineNumber, user, var)
elif dir:
fileErrorDict[fileName][lineNumber] = [11, var]
varDict[defCounter].remove(var)
break
except VariableSnakeCaseError as error:
print(error)
def mutableArgumentError(lineNumber, line, fileName=0):
global fileErrorDict
global astScript
global dir
global user
global defCounter
global absFilePath
tree = ast.parse(astScript)
if dir:
file = absFilePath[-9::]
elif not dir:
file = user[-9::]
if file == 'test_3.py':
try:
if isinstance(tree.body[0].body[2].args.defaults[0].elts, (list, dict)) and '[]' in line:
if not dir:
raise MutableError(lineNumber, user)
elif dir:
fileErrorDict[fileName][lineNumber] = [12]
except MutableError as error:
print(error)
def indexSubtractor():
global hashtagIndex
global semiColonIndex
global leftBrackIndex
global classLine
hashtagIndex = -1
semiColonIndex = -1
leftBrackIndex = -1
classLine = 10000
def errorParser(errorCode, lineNum, absFilePath, errorCode0=0):
try:
if errorCode == 1:
raise TooLongError(lineNum, absFilePath)
elif errorCode == 2:
raise IndentationError(lineNum, absFilePath)
elif errorCode == 3:
raise RedundantSemicolonError(lineNum, absFilePath)
elif errorCode == 4:
raise InlineSpaceError(lineNum, absFilePath)
elif errorCode == 5:
raise TODOError(lineNum, absFilePath)
elif errorCode == 6:
raise BlankLinesError(lineNum, absFilePath)
elif errorCode == 7:
# if errorCode0 == 7:
raise SpaciousConstructerError(lineNum, absFilePath, errorCode0)
elif errorCode == 8:
raise ClassCamelCaseError(lineNum, absFilePath, errorCode0)
elif errorCode == 9:
raise FuncSnakeCaseError(lineNum, absFilePath, errorCode0)
elif errorCode == 10:
raise ArgumentSnakeCaseError(lineNum, absFilePath, errorCode0)
elif errorCode == 11:
raise VariableSnakeCaseError(lineNum, absFilePath, errorCode0)
elif errorCode == 12:
raise MutableError(lineNum, absFilePath)
except TooLongError as error:
print(error)
except IndentationError as error:
print(error)
except RedundantSemicolonError as error:
print(error)
except InlineSpaceError as error:
print(error)
except TODOError as error:
print(error)
except BlankLinesError as error:
print(error)
except SpaciousConstructerError as error:
print(error)
except ClassCamelCaseError as error:
print(error)
except FuncSnakeCaseError as error:
print(error)
except ArgumentSnakeCaseError as error:
print(error)
except VariableSnakeCaseError as error:
print(error)
except MutableError as error:
print(error)
def catchErrors():
global fileErrorDict
global dir
global linesList
global hashtagIndex
global firstCharIndex
global defCounter
global astScript
global absFilePath
checkFileOrFolder()
if not dir:
createVarDict(astScript, user)
for lineNumber, line in enumerate(linesList, start=1):
indexFinder(line)
tooLongError(lineNumber, line)
indentationError(lineNumber, line)
redundantSemicolonError(lineNumber, line)
inlineSpaceError(lineNumber, line)
tODOError(lineNumber, line)
blankLinesError(lineNumber)
spaciousConstructorError(lineNumber, line)
classCamelCaseError(lineNumber, line)
funcSnakeCaseError(lineNumber, line)
if user[-9::] in ['test_3.py', 'test_4.py', 'test_5.py']:
argumentSnakeCaseError(lineNumber, line)
variableSnakeCaseError(lineNumber, line)
mutableArgumentError(lineNumber, line)
indexSubtractor()
# print(errorDict)
elif dir:
getMaxLines()
createDict()
for file in fileList:
absFilePath = joinedPath + '\\' + file
fileOpener(absFilePath)
with open(absFilePath, 'r') as astFile:
astScript = astFile.read()
createVarDict(astScript, file)
for lineNumber, line in enumerate(linesList, start=1):
indexFinder(line)
tooLongError(lineNumber, line, file)
indentationError(lineNumber, line, file)
redundantSemicolonError(lineNumber, line, file)
inlineSpaceError(lineNumber, line, file)
tODOError(lineNumber, line, file)
blankLinesError(lineNumber, file)
spaciousConstructorError(lineNumber, line, file)
classCamelCaseError(lineNumber, line, file)
funcSnakeCaseError(lineNumber, line, file)
if file in ['test_3.py', 'test_4.py', 'test_5.py']:
argumentSnakeCaseError(lineNumber, line, file)
variableSnakeCaseError(lineNumber, line, file)
mutableArgumentError(lineNumber, line, file)
indexSubtractor()
defCounter = -1
# print(dict(reversed(list(fileErrorDict.items()))))
revFileList = fileList[::-1]
for file in fileList:
if file == 'tests.py':
continue
absFilePath = joinedPath + '\\' + file
for lineNum in range(1, (maxLines + 1)):
errorList = fileErrorDict[file][lineNum]
if len(errorList) >= 1:
# if errorList[0] in [7, 8, 9]:
# errorParser(errorList, lineNum, absFilePath, errorList[0], errorList[1])
# else:
for errorCode in errorList:
if errorCode in [7, 8 ,9, 10, 11]:
errorParser(errorCode, lineNum, absFilePath, errorList[1])
break
errorParser(errorCode, lineNum, absFilePath)
# elif
def debugger(line):
indexFinder(line)
# redundantSemicolonError(3, line)
# blankLinesError(11)
# inlineSpaceError(1, "print('What\'s your name?') # reading an input\n", 27, 0)
redundantSemicolonError(3, line)
# indentationError(12, " very_big_number")
# CHECK = TODOError(1, 3)
# TooLongError()
# indexFinder("he")
catchErrors()
# checkFileOrFolder()
# getMaxLines()
# createDict()
# print(fileErrorDict['__init__.py'][1])
# debugger(" print = he;")
# redundantSemicolonError(3, " print = he;")
# test 2, comment semi colons