coala / coala-bears

Bears for coala
https://coala.io/
GNU Affero General Public License v3.0
295 stars 580 forks source link

IndentationBear is buggy. #1516

Open aptrishu opened 7 years ago

aptrishu commented 7 years ago

Test file

print('hello world')
dict = {'a':1,'b':2}
def hey():
    print('hmm')
    if True:
        if True:
         h = 5
    g = 8

output

print('hello world')
dict = {'a':1,'b':2}
def hey():
print('hmm')
if True:
if True:
h = 5
g = 8

language Python

aptrishu commented 7 years ago

works(almost) for c++ code though.

abhay-raizada commented 7 years ago

I think this is the reason: https://github.com/coala/coala-bears/blob/master/bears/general/IndentationBear.py#L72 IndentationBear had a hacky solution to the previous LanguageDefinition but it's not adapted to the new coala update, we don't use it anywhere so we don't get to know the problems