Skip to content

Commit

Permalink
When live_mode is off, only lint when document is saved
Browse files Browse the repository at this point in the history
  • Loading branch information
tomv564 committed Oct 3, 2019
1 parent e5ca814 commit 8447538
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyls_mypy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,20 @@ def parse_line(line, document=None):


@hookimpl
def pyls_lint(config, document):
def pyls_lint(config, workspace, document, is_saved):
live_mode = config.plugin_settings('pyls_mypy').get('live_mode', True)
if live_mode:
args = ['--incremental',
'--show-column-numbers',
'--follow-imports', 'silent',
'--command', document.source]
else:
elif is_saved:
args = ['--incremental',
'--show-column-numbers',
'--follow-imports', 'silent',
document.path]
else:
return []

report, errors, _ = mypy_api.run(args)

Expand Down

0 comments on commit 8447538

Please sign in to comment.