diff options
author | ZyX <kp-pav@yandex.ru> | 2017-12-23 15:47:23 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-12-23 15:47:23 +0300 |
commit | 5cb7a709e7f60b0e7bcde70a1aa9fea5f060fe0f (patch) | |
tree | 49e4ea82c9ff4b43d1e7bf0448ea707e614633ef /src | |
parent | d2c01d529fb618889ffc25083ba14461ef22f57a (diff) | |
download | rneovim-5cb7a709e7f60b0e7bcde70a1aa9fea5f060fe0f.tar.gz rneovim-5cb7a709e7f60b0e7bcde70a1aa9fea5f060fe0f.tar.bz2 rneovim-5cb7a709e7f60b0e7bcde70a1aa9fea5f060fe0f.zip |
clint: Make linter report line where it found opening brace
Diffstat (limited to 'src')
-rwxr-xr-x | src/clint.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/clint.py b/src/clint.py index 8426807c80..79ab91ebe1 100755 --- a/src/clint.py +++ b/src/clint.py @@ -2124,8 +2124,10 @@ def CheckExpressionAlignment(filename, clean_lines, linenum, error, startpos=0): + (level_starts[depth][2] == '{')): if depth not in ignore_error_levels: error(filename, linenum, 'whitespace/alignment', 2, - 'Inner expression should be aligned ' - 'as opening brace + 1 (+ 2 in case of {)') + ('Inner expression should be aligned ' + 'as opening brace + 1 (+ 2 in case of {{). ' + 'Relevant opening is on line {0!r}').format( + level_starts[depth][3])) prev_line_start = pos elif brace == 'e': pass @@ -2142,7 +2144,8 @@ def CheckExpressionAlignment(filename, clean_lines, linenum, error, startpos=0): ignore_error_levels.add(depth) line_ended_with_opening = ( pos == len(line) - 2 * (line.endswith(' \\')) - 1) - level_starts[depth] = (pos, line_ended_with_opening, brace) + level_starts[depth] = (pos, line_ended_with_opening, brace, + linenum) if line_ended_with_opening: depth_line_starts[depth] = (prev_line_start, brace) else: |