File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ def pyls_lint(config, document):
30
30
diags .append ({
31
31
'source' : 'mccabe' ,
32
32
'range' : {
33
- 'start' : {'line' : graph .lineno , 'character' : graph .column },
34
- 'end' : {'line' : graph .lineno , 'character' : len (document .lines [graph .lineno ])},
33
+ 'start' : {'line' : graph .lineno - 1 , 'character' : graph .column },
34
+ 'end' : {'line' : graph .lineno - 1 , 'character' : len (document .lines [graph .lineno ])},
35
35
},
36
36
'message' : 'Cyclomatic complexity too high: %s (threshold %s)' % (graph .complexity (), threshold ),
37
37
'severity' : lsp .DiagnosticSeverity .Warning
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ def test_mccabe(config):
26
26
mod_import = [d for d in diags if d ['message' ] == msg ][0 ]
27
27
28
28
assert mod_import ['severity' ] == lsp .DiagnosticSeverity .Warning
29
- assert mod_import ['range' ]['start' ] == {'line' : 1 , 'character' : 0 }
30
- assert mod_import ['range' ]['end' ] == {'line' : 1 , 'character' : 6 }
29
+ assert mod_import ['range' ]['start' ] == {'line' : 0 , 'character' : 0 }
30
+ assert mod_import ['range' ]['end' ] == {'line' : 0 , 'character' : 6 }
31
31
finally :
32
32
config ._settings = old_settings
33
33
You can’t perform that action at this time.
0 commit comments