Starting to refactor the normalizer to make sure that comments are also checked for indentation.

Using a linked list now for the indentation stack.
This commit is contained in:
Dave Halter
2017-07-02 18:58:43 +02:00
parent 7a7ad2038d
commit 36a59a3d3b
4 changed files with 120 additions and 122 deletions

View File

@@ -4,14 +4,15 @@ if x > 2:
if True:
#: E111:5
print
#: E116:6
#: E111:6
#
#: E116:2
#: E111:2
# what
# Comment is fine
# Comment is also fine
if False:
pass
print
print
# TODO this shouldn't actually be a 111 but an IndentationError. Please
@@ -19,37 +20,40 @@ print
#: E111:4
print
mimetype = 'application/x-directory'
#: E116:5
#: E111:5
# 'httpd/unix-directory'
create_date = False
def start(self):
# foo
#: E111:8
# bar
if True: # Hello
self.master.start() # Comment
# try:
#: E116:12
#: E111:12
# self.master.start()
# except MasterExit:
#: E116:12
#: E111:12
# self.shutdown()
# finally:
#: E116:12
#: E111:12
# sys.exit()
# Dedent to the first level
#: E116:6
#: E111:6
# error
# Dedent to the base level
#: E116:2
#: E111:2
# Also wrongly indented.
# Indent is correct.
def start(self): # Correct comment
if True:
#: E115:0
#: E111:0
# try:
#: E115:0
#: E111:0
# self.master.start()
#: E115:0
#: E111:0
# except MasterExit:
#: E115:0
#: E111:0
# self.shutdown()
self.master.start() # comment