1430 |
1430 |
1431 # This is necessary since pycodestyle sometimes reports columns that |
1431 # This is necessary since pycodestyle sometimes reports columns that |
1432 # goes past the end of the physical line. This happens in cases like, |
1432 # goes past the end of the physical line. This happens in cases like, |
1433 # foo(bar\n=None) |
1433 # foo(bar\n=None) |
1434 col = min(pos, len(text) - 1) |
1434 col = min(pos, len(text) - 1) |
1435 if text[col].strip(): |
1435 newText = ( |
1436 newText = text |
1436 text |
1437 else: |
1437 if text[col].strip() else |
1438 newText = text[:col].rstrip() + text[col:].lstrip() |
1438 text[:col].rstrip() + text[col:].lstrip() |
|
1439 ) |
1439 |
1440 |
1440 # There could be an escaped newline |
1441 # There could be an escaped newline |
1441 if newText.endswith(('=\\\n', '=\\\r\n', '=\\\r')): |
1442 if newText.endswith(('=\\\n', '=\\\r\n', '=\\\r')): |
1442 self.__source[line] = newText.rstrip("\n\r \t\\") |
1443 self.__source[line] = newText.rstrip("\n\r \t\\") |
1443 self.__source[line + 1] = self.__source[line + 1].lstrip() |
1444 self.__source[line + 1] = self.__source[line + 1].lstrip() |