-
Notifications
You must be signed in to change notification settings - Fork 20
Description
In parallel to an issue over at AtomLinter, SublimeLinter-pylint produces spurious error messages when analysing dotted relative import statements inside a Python package.
For example, consider the following package (directory) structure:
working directory
| - package
| | - foo
| | | - bar.py
| | | - baz.py
In the module bar.py
, it's totally fine (AFAIK) to write:
from . import baz
However, if you simply run
pylint package/foo/bar.py
it will show an error "Attempted relative import beyond top-level package", because it doesn't recognize bar.py
is part of a package.
This is also what I see in the editor when SublimeLinter-pylint is enabled.
In order for pylint
to acknowledge the package structure, you have to run
pylint package.foo.bar
Is there any way for SublimeLinter to detect packages and adjust the calls to pylint
accordingly?
Or is there at least a way to tell SublimeLinter-pylint where the package root is?
Please note: This is all Python 3.