Get the indentation errors of files mostly right even in comments.

This commit is contained in:
Dave Halter
2017-06-07 17:06:48 +02:00
parent b73aa1fd61
commit 03c34d6105
4 changed files with 126 additions and 11 deletions

View File

@@ -0,0 +1,52 @@
if x > 2:
#: E111:2
print x
if True:
#: E111:5
print
#: E116:6
#
#: E116:2
# what
# Comment is fine
# Comment is also fine
if False:
print
print
print
mimetype = 'application/x-directory'
#: E116:5
# 'httpd/unix-directory'
create_date = False
def start(self):
if True: # Hello
self.master.start() # Comment
# try:
#: E116:12
# self.master.start()
# except MasterExit:
#: E116:12
# self.shutdown()
# finally:
#: E116:12
# sys.exit()
# Dedent to the first level
#: E116:6
# error
# Dedent to the base level
#: E116:2
# Also wrongly indented.
# Indent is correct.
def start(self): # Correct comment
if True:
#: E115:0
# try:
#: E115:0
# self.master.start()
#: E115:0
# except MasterExit:
#: E115:0
# self.shutdown()
self.master.start() # comment

View File

@@ -1,7 +1,7 @@
#: E721
#: E721:3
if type(res) == type(42):
pass
#: E721
#: E721:3
if type(res) != type(""):
pass