diff --git a/test/linter/flake8_spec.lua b/test/linter/flake8_spec.lua index 4fe65d9..7a894b6 100644 --- a/test/linter/flake8_spec.lua +++ b/test/linter/flake8_spec.lua @@ -10,7 +10,7 @@ describe('flake8', function() [[def foo(n):]], [[ if n == 0:]], [[ return bar]], - [[print('too long sentence to be displayed in one line blah blah blah blah blah blah blah blah blah blah blah blah blah')]], + [[print("it's too long sentence to be displayed in one line, blah blah blah blah")]], }) assert.are.same({ { @@ -37,8 +37,30 @@ describe('flake8', function() }, { bufnr = 3, - col = 14, - end_col = 14, + col = 9, + end_col = 9, + end_lnum = 4, + lnum = 4, + message = 'indentation is not a multiple of 4 [111]', + namespace = 4, + severity = 1, + source = 'flake8', + }, + { + bufnr = 3, + col = 9, + end_col = 9, + end_lnum = 4, + lnum = 4, + message = 'over-indented [117]', + namespace = 4, + severity = 1, + source = 'flake8', + }, + { + bufnr = 3, + col = 15, + end_col = 15, end_lnum = 4, lnum = 4, message = 'multiple spaces after keyword [271]', @@ -48,8 +70,8 @@ describe('flake8', function() }, { bufnr = 3, - col = 16, - end_col = 16, + col = 17, + end_col = 17, end_lnum = 4, lnum = 4, message = "undefined name 'bar' [821]", @@ -59,13 +81,24 @@ describe('flake8', function() }, { bufnr = 3, - col = 19, - end_col = 19, - end_lnum = 4, - lnum = 4, - message = 'trailing whitespace [291]', + col = 0, + end_col = 0, + end_lnum = 5, + lnum = 5, + message = 'expected 2 blank lines after class or function definition, found 0 [305]', namespace = 4, - severity = 2, + severity = 1, + source = 'flake8', + }, + { + bufnr = 3, + col = 79, + end_col = 79, + end_lnum = 5, + lnum = 5, + message = 'line too long (80 > 79 characters) [501]', + namespace = 4, + severity = 1, source = 'flake8', }, }, diagnostics)